示例#1
0
    void Start()
    {
        PlayerCtr = FindObjectOfType <PlayerContrl>();
        pv        = GetComponent <PhotonView>();

        if (!pv.IsMine)
        {
            PlayerCtr           = FindObjectOfType <PlayerContrl>();
            pv.transform.parent = PlayerCtr.transform;
        }
        if (pv.IsMine)
        {
            PlayerCtr           = FindObjectOfType <PlayerContrl>();
            pv.transform.parent = PlayerCtr.transform;
        }
    }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     //playerCtrl = GameObject.Find("Hero").GetComponent<PlayerContrl>();
     playerCtrl = transform.parent.GetComponent <PlayerContrl>();
 }