예제 #1
0
    public void OnPhotonInstantiate(PhotonMessageInfo info)
    {
        if (!photonView.IsMine)
        {
            characterCamera.SetActive(false);

            if (audioSource)
            {
                audioSource.enabled = false;
            }

            GameState.Instance._networkCharacterList.Add(this);

            DualStickShooterCharaMotor joyStick = GetComponent <DualStickShooterCharaMotor>();

            joyStick.enabled = false;

            if (salsaComponent)
            {
                salsaComponent.enabled = false;
            }
            if (randomEyesComponent)
            {
                randomEyesComponent.enabled = false;
            }
        }
        else
        {
            //Transform[] positions = GameManager.Instance.photonManager.transform.GetComponentsInChildren<Transform>();
            //transform.position = positions[Random.Range(0, positions.Length)].position;

            Transform[] childs = GetComponentsInChildren <Transform>();
            foreach (var child in childs)
            {
                child.gameObject.layer = LayerMask.NameToLayer("SelfOcclude");
            }
            if (audioRenderer)
            {
                audioRenderer.enabled = true;
            }

            GameState.Instance.ovr_context = context;

            //.enabled = false;

            //controller
            //JoyStickController.Instance.transform.Find("Movement").gameObject.SetActive(true);
            //JoyStickController.Instance.transform.Find("Rotation").gameObject.SetActive(true);
            //JoyStickController.Instance.SetTarget(transform);
        }
    }
예제 #2
0
    public void initCharacter(uint udid, bool isMine = false)
    {
        m_IsMine = isMine;
        UDID     = udid;

        if (isMine)
        {
            //Transform[] positions = GameManager.Instance.photonManager.transform.GetComponentsInChildren<Transform>();
            //transform.position = positions[Random.Range(0, positions.Length)].position;

            Transform[] childs = GetComponentsInChildren <Transform>();
            foreach (var child in childs)
            {
                child.gameObject.layer = LayerMask.NameToLayer("SelfOcclude");
            }

            GameState.Instance.ovr_context = context;

            if (audioSource)
            {
                audioSource.enabled = false;
            }
            if (salsaComponent)
            {
                salsaComponent.enabled = false;
            }
            if (randomEyesComponent)
            {
                randomEyesComponent.enabled = false;
            }

            //.enabled = false;

            //controller
            //JoyStickController.Instance.transform.Find("Movement").gameObject.SetActive(true);
            //JoyStickController.Instance.transform.Find("Rotation").gameObject.SetActive(true);
            //JoyStickController.Instance.SetTarget(transform);
        }
        else
        {
            characterCamera.SetActive(false);

            if (audioSource)
            {
                audioSource.Play();
            }


//micInput.enabled = false;

//GameState.Instance._networkCharacterList.Add(this);

#if USE_JOYSTICK
            DualStickShooterCharaMotor joyStick = GetComponent <DualStickShooterCharaMotor>();

            joyStick.enabled = false;
#endif

            //if (salsaComponent)
            //    salsaComponent.enabled = false;
            //if (randomEyesComponent)
            //    randomEyesComponent.enabled = false;
        }
    }