Ejemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     animator        = GetComponent <Animator>();
     photonGM        = GameObject.Find("PhotonGM").GetComponent <photonGmaeManager>();
     playerName.text = photonView.Owner.NickName;
     if (photonView.IsMine)
     {
         cameraFlow        = GameObject.Find("Main Camera").GetComponent <CameraFlow>();
         cameraFlow.target = gameObject;
         if (photonGM.isSubuerver)
         {
             thisplayer.tag = "Subuerver";
         }
         else
         {
             if (photonGM.anemyTag == "A")
             {
                 thisplayer.tag = "A";
             }
             if (photonGM.anemyTag == "B")
             {
                 thisplayer.tag = "B";
             }
         }
     }
     agent       = this.GetComponent <NavMeshAgent>();
     PlayerKinds = playerKinds.stop;
     StartCoroutine(this.State());
 }
Ejemplo n.º 2
0
 public void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }