Exemple #1
0
    // Use this for initialization
    void Start()
    {
        thisTrans  = this.transform;
        playerBody = this.gameObject.GetComponent <Rigidbody2D>();

        CameraWork camWork = this.gameObject.GetComponent <CameraWork>();


        if (camWork != null)
        {
            if (photonView.isMine)
            {
                camWork.OnStartFollow();
            }
        }

        if (playerUiPrefab != null)
        {
            if (photonView.isMine)
            {
                GameObject uiGo = Instantiate(playerUiPrefab) as GameObject;
                playerJoyStick = GameObject.FindGameObjectWithTag("PlayerJoyStick").GetComponentInChildren <PlayerJoyStick>();
                uiGo.GetComponent <Transform>().SetParent(GameObject.Find("Canvas").GetComponent <Transform>(), false);
            }
        }
    }
 void Start()
 {
     playerJoyStick = GameObject.Find("Player").GetComponent <PlayerJoyStick> ();
 }
Exemple #3
0
 private void Start()
 {
     playerSelectionScript = GameObject.Find("RolePickerCanvas").GetComponent <PlayerSelection>();
     playerJoyStickScript  = GameObject.Find("ThiefJoyStickBackground").GetComponentInChildren <PlayerJoyStick>();
 }