// Initializes Object public override void Initialize(Item parent, A_ItemBehaviour behaviourParameters) { this.parentReference = parent; healAmountPerIncrement = ((HealOverTimePack) behaviourParameters).HealAmount; maxTime = ((HealOverTimePack) behaviourParameters).MaxTime; timeIncrements = ((HealOverTimePack) behaviourParameters).TimeIncrements; }
public override void OnInspectorGUI() { if (myTarget == null) myTarget = (Item)target; EditorGUILayout.Space(); /// Inspector UI For Variables EditorGUILayout.LabelField("Item Information", EditorStyles.boldLabel,GUILayout.MaxWidth(80)); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Item Name", GUILayout.MaxWidth(80)); myTarget.Itemname = (string)EditorGUILayout.TextField(myTarget.Itemname, GUILayout.MinWidth(50)); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("UI Image: ", GUILayout.MaxWidth(80)); myTarget.UITexture = (Sprite)EditorGUILayout.ObjectField(myTarget.UITexture, typeof(Sprite), true); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Item Behaviour", EditorStyles.boldLabel); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Event Class: ", GUILayout.MaxWidth(80)); myTarget.ItemBehaviourType = (EBehaviourType)EditorGUILayout.EnumPopup(myTarget.ItemBehaviourType); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); switch (myTarget.ItemBehaviourType) { case EBehaviourType.SelectOne: break; case EBehaviourType.HealOverTimePack: ValidateCurrentBehaviourClass(typeof(HealOverTimePack)); DrawHealOverTimePackInspector(); break; } EditorGUILayout.Space(); }
// Abstract classes to act and initialize public abstract void Initialize( Item parent, A_ItemBehaviour behaviourParameters );