void FixedUpdate() { if (!ninjaBehaviour.AmIMyself()) { // Avoid messing with objects owned by the other player. return; } switch (state) { case State.Pouncing: pounceForwardWithSwordInHand(); break; case State.Blocking: standStillBlockingAttacks(); break; case State.ReadyToFight: handleUserInput(); break; } if (stateResetTime < Time.time && state != State.ReadyToFight) { state = State.ReadyToFight; pokerAnimation.Stand(); } }
void OnTriggerEnter(Collider other) { if (other.tag == "Sword") { if (ninjaBehaviour.AmIMyself()) { networkView.RPC("OnPoked", RPCMode.All, ninjaWalker.IsBlocking()); } } }