예제 #1
0
    protected void bAwake()
    {
        sound_manager = GameObject.FindGameObjectWithTag("Sound_Manager").GetComponent<Sound_Manager>().GetInstance();
        navAgent = GetComponent<NavMeshAgent>();
        navObstacle = GetComponent<NavMeshObstacle>();
        navAgent.speed = moveSpeed;
        pcontroller = GameObject.Find("PlayerControl").GetComponent<PlayerController>();

        if (PhotonNetwork.connected)
        {
            isSinglePlayer = (bool)photonView.instantiationData[0];
        }
        else
        {
            isSinglePlayer = true;
        }

        depleteTimer = DEPLETE_TIME;
        if (isSinglePlayer)
        {
            // GetComponent<PhotonView>().enabled = false;

        }
        else
        {
            isMine = photonView.isMine;
        }

        if (isMine)
        {
            gameObject.AddComponent<FogOfWarViewer>();
        }
        else if (!isMine && isAIPossessed)
        {
            gameObject.AddComponent<FogOfWarHider>();

        }
        else if (!isMine)
        {
            gameObject.AddComponent<FogOfWarHider>();
        }

        pcontroller.AddNewCell(this);
    }