public void LookAtTile(int z) { CharacterController myCharacter = characterManager.Get(PhotonNetwork.player.ID); if (myCharacter.CharPos().z <= z) { myCharacter.transform.rotation = Quaternion.Euler(0, 0, 0); photonView.RPC("RpcLookAtTile", PhotonTargets.Others, myCharacter.transform.rotation); } else if (myCharacter.CharPos().z >= z) { myCharacter.transform.rotation = Quaternion.Euler(0, 180, 0); photonView.RPC("RpcLookAtTile", PhotonTargets.Others, myCharacter.transform.rotation); } }
public void RpcLookAtTarget(int playerID) { CharacterController myCharacter = characterManager.Get(playerID); CharacterController targetCharacter = characterManager.GetOther(); if (targetCharacter != null) { if (myCharacter.CharPos().z <= targetCharacter.CharPos().z) { myCharacter.transform.rotation = Quaternion.Euler(0, 0, 0); targetCharacter.transform.rotation = Quaternion.Euler(0, 180, 0); } else if (myCharacter.CharPos().z >= targetCharacter.CharPos().z) { myCharacter.transform.rotation = Quaternion.Euler(0, 180, 0); targetCharacter.transform.rotation = Quaternion.Euler(0, 0, 0); } } }
public override void OnExit() { ctn.OffCollider(); if (ctn.AP > 0) { ctn.OnCollider(); } CharacterController targetPlayer = Character.Manager.Single.GetOther(); ctn.ConsumeAP(CharacterData.instance.GetConsumption(ctn.selectedSkillIndex, ctn.CharacterType.ToString())); Helper.RPC.Send("RpcSetSkill", PhotonTargets.Others, ctn.PlayerID, CharacterData.instance.GetConsumption(ctn.selectedSkillIndex, ctn.CharacterType.ToString())); if (targetPlayer.CharPos().z == SkillTileZ) { if (ctn.CharPos().z <= SkillTileZ) { if (SkillTileZ == 7) { return; } ctn.SetPosition(SkillTileX, SkillTileZ + 1); } else if (ctn.CharPos().z >= SkillTileZ) { if (SkillTileZ == 0) { return; } ctn.SetPosition(SkillTileX, SkillTileZ - 1); } } else { ctn.SetPosition(SkillTileX, SkillTileZ); } ctn.OnSkillTrigger(); }