void OnSceneGUI() { FinalKill damager = (FinalKill)target; if (!damager.enabled) { return; } Matrix4x4 handleMatrix = damager.transform.localToWorldMatrix; handleMatrix.SetRow(0, Vector4.Scale(handleMatrix.GetRow(0), new Vector4(1f, 1f, 0f, 1f))); handleMatrix.SetRow(1, Vector4.Scale(handleMatrix.GetRow(1), new Vector4(1f, 1f, 0f, 1f))); handleMatrix.SetRow(2, new Vector4(0f, 0f, 1f, damager.transform.position.z)); using (new Handles.DrawingScope(handleMatrix)) { s_BoxBoundsHandle.center = damager.offset; s_BoxBoundsHandle.size = damager.size; s_BoxBoundsHandle.SetColor(s_EnabledColor); EditorGUI.BeginChangeCheck(); s_BoxBoundsHandle.DrawHandle(); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(damager, "Modify Damager"); damager.size = s_BoxBoundsHandle.size; damager.offset = s_BoxBoundsHandle.center; } } }
public void CatchDamageableAnim(FinalKill finalKill, Damageable damageable) { if (damageable.CurrentHealth > 0) { d_anim = damageable.GetComponent <Animator>(); } }
public void BeFinalKIll(FinalKill damager, Damageable damageable) { Debug.Log("beFinalKill !!! "); anim.SetTrigger(m_DieState); //暂时为死亡状态,本应是倒地之类的 if (damageable.CurrentHealth <= 0) { CloseLayerMask("Player"); } }
public void TakeFinalKill(FinalKill finalKill) { m_CurrentHealth -= finalKill.damage; OnHealthSet.Invoke(this); OnTakeFinalKillDamage.Invoke(finalKill, this); }