public override void OnInspectorGUI() { currAttackStruct = target as AttackStruct; //base.OnInspectorGUI(); if (currAttackStruct != null) { BasicDisplay(); } }
protected virtual void OnAttackStart(AttackStruct newStruct) { //Debug.Log("Start"); m_attackType = (AttackType)m_animator.GetInteger("AttackType"); //Debug.Log("Attack type = " + m_attackType); m_currAttackStruct = newStruct; m_animator.SetBool("Attacking", true); OnAttackStateEvent.Invoke(true); OnAttackBeginEvent.Invoke(m_attackType); }
protected override void OnAttackStart(AttackStruct newStruct) { //Debug.Log("Start"); if (m_animator.GetBool("Recovering")) { OnAttackEnd(); } base.OnAttackStart(newStruct); }
public void Display() { range = EditorGUILayout.FloatField("Range", range); int tickDamageNb = (atkStruct != null) ? atkStruct.attackDatas.Length : 0; EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); EditorGUILayout.LabelField("Timer", EditorStyles.boldLabel); startUpDuration = EditorGUILayout.FloatField("Start Up", startUpDuration); connectDuration = EditorGUILayout.FloatField("Connect (x" + tickDamageNb + ")", connectDuration); recoveryDuration = EditorGUILayout.FloatField("Recovery", recoveryDuration); animationDuration = startUpDuration + recoveryDuration + (connectDuration * tickDamageNb); EditorGUILayout.LabelField("Connection time = " + connectDuration * tickDamageNb, EditorStyles.boldLabel); EditorGUILayout.LabelField("Animation time = " + animationDuration, EditorStyles.boldLabel); EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); atkStruct = EditorGUILayout.ObjectField("Damage Structure", atkStruct, typeof(AttackStruct), false) as AttackStruct; if (atkStruct) { atkStruct.Display(); } }