void Start() { Live(); m_ActiveMoveset = MOVE_SET.OFFENSIVE; GetComponentInChildren <Rigidbody>().constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; ownCollider = GetComponentInChildren <SphereCollider>(); }
void Live() { fEnergy = 0.0f; m_ActiveMoveset = MOVE_SET.OFFENSIVE; m_Active = true; }
void CheckForPowerInput(PLAYER player) { const float Level1Energy = 0.25f; const float Level2Energy = 0.5f; const float Level3Energy = 0.75f; const float Level4Energy = 1.00f; if (Input.GetButtonDown("FlipMoveSet" + (int)player)) { if (m_ActiveMoveset == MOVE_SET.DEFFENSIVE) { m_ActiveMoveset = MOVE_SET.OFFENSIVE; } else { m_ActiveMoveset = MOVE_SET.DEFFENSIVE; } } if (Input.GetButtonDown("Stun/Slide" + (int)player) && fEnergy >= Level2Energy) { fEnergy = Mathf.Max(fEnergy - Level2Energy, 0.0f); if (m_ActiveMoveset == MOVE_SET.OFFENSIVE) { LaunchPower(POWER.STUN); } else { LaunchPower(POWER.SLIDE); } } if (Input.GetButtonDown("Dash/Parry" + (int)player) && fEnergy >= Level1Energy) { fEnergy = Mathf.Max(fEnergy - Level1Energy, 0.0f); if (m_ActiveMoveset == MOVE_SET.OFFENSIVE) { LaunchPower(POWER.DASH); } else { LaunchPower(POWER.PARRY); } } if (Input.GetButtonDown("Barrier/Chained" + (int)player) && fEnergy >= Level3Energy) { fEnergy = Mathf.Max(fEnergy - Level3Energy, 0.0f); if (m_ActiveMoveset == MOVE_SET.OFFENSIVE) { LaunchPower(POWER.CHAINED); } else { LaunchPower(POWER.BARRIER); } } if (Input.GetButtonDown("Bomb/Overlord" + (int)player) && fEnergy >= Level4Energy) { fEnergy = Mathf.Max(fEnergy - Level4Energy, 0.0f); if (m_ActiveMoveset == MOVE_SET.OFFENSIVE) { LaunchPower(POWER.OVERLORD); } else { LaunchPower(POWER.BOMB); } } }