Пример #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);
            }
        }
    }