using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Arbor;
[System.Serializable]publicclassEnemyInfo
{
// Declare Serialize Fields
}
[System.Serializable]publicclassFlexibleEnemyInfo : FlexibleField<EnemyInfo>
{
public FlexibleEnemyInfo(EnemyInfo value) : base(value)
{
}
public FlexibleEnemyInfo(AnyParameterReference parameter) : base(parameter)
{
}
public FlexibleEnemyInfo(InputSlotAny slot) : base(slot)
{
}
publicstaticexplicitoperator EnemyInfo(FlexibleEnemyInfo flexible)
{
return flexible.value;
}
publicstaticexplicitoperator FlexibleEnemyInfo(EnemyInfo value)
{
returnnew FlexibleEnemyInfo(value);
}
}
[System.Serializable]publicclassInputSlotEnemyInfo : InputSlot<EnemyInfo>
{
}
[System.Serializable]publicclassOutputSlotEnemyInfo : OutputSlot<EnemyInfo>
{
}
[AddComponentMenu("")]publicclassEnemyInfoVariable : Variable<EnemyInfo>
{
}
EnemyInfoListVariable.cs
1
2
3
4
5
6
7
8
9
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Arbor;
[AddComponentMenu("")]publicclassEnemyInfoListVariable : VariableList<EnemyInfo>
{
}
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Arbor;
[AddComponentMenu("")]publicclassEnemyInfoBehaviour : StateBehaviour {
public FlexibleEnemyInfo enemyInfo;
// Use this for enter state
publicoverridevoid OnStateBegin()
{
EnemyInfo value = enemyInfo.value;
Debug.Log(value.displayName);
}
}
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Arbor;
[AddComponentMenu("")]publicclassEnemyInfoBehaviour2 : StateBehaviour {
[ClassExtends(typeof(EnemyInfo))]public AnyParameterReference enemyInfo = new AnyParameterReference();
// Use this for enter state
publicoverridevoid OnStateBegin()
{
Parameter enemyInfoParameter = enemyInfo.parameter;
if (enemyInfoParameter != null)
{
EnemyInfo value = enemyInfoParameter.valueas EnemyInfo;
Debug.Log(value.displayName);
}
}
}