void Start()
    {
        _motion   = Vector3.zero;
        _rotation = Vector3.zero;
        _pitch    = 0f;
        if (isLocalPlayer)
        {
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible   = false;
            _sfx             = GetComponents <AudioSource>();
            g                = GetComponent <Grabber>();
            _camera          = Camera.allCameras[0].transform;
            _camera.position = transform.position - new Vector3(0, -7f, .5f);
            _camera.gameObject.GetComponent <Camera>().cullingMask &= ~(1 << LayerMask.NameToLayer("CameraInvisible"));
            _camera.SetParent(transform);
            _emitter = GetComponent <Splatter>();
            _emitter.SetEmitter(transform.GetChild(2).transform);
            _emitter.SetChannel(_splatChannel);
            //_body = GetComponent<Rigidbody>();
            _front = GetComponent <CharacterController>();
            TPMesh.SetActive(false);
            LeftArm.SetActive(true);
            RightArm.SetActive(true);

            /*_rightGrabRotation = RightArm.transform.localRotation;
             * _leftGrabRotation = LeftArm.transform.localRotation;
             * LeftArm.transform.Rotate(new Vector3(90, 0, 0));
             * RightArm.transform.Rotate(new Vector3(90, 0, 0));
             * _rightDownRotation = RightArm.transform.localRotation;
             * _leftDownRotation = LeftArm.transform.localRotation;
             */
            _animator = LeftArm.GetComponentInChildren <Animator>();
        }
    }
示例#2
0
    void Start()
    {
        _frontPivot = transform.Find("frontPivot");
        _rearPivot  = transform.Find("rearPivot");
        FrontPeePoofs.transform.position = _frontPivot.transform.position;
        RearPeePoofs.transform.position  = _rearPivot.transform.position;
        _front          = GetComponent <Rigidbody>();
        _animator       = this.GetComponentInChildren <Animator>();
        _inputH         = GetComponent <InputHandler>();
        _sfx            = GetComponents <AudioSource>();
        _runStartVolume = _sfx [2].volume;
        d = GetComponent <Drinker>();

        if (isLocalPlayer)
        {
            _emitter = GetComponent <Splatter>();
            _emitter.SetEmitter(transform.Find("rearPivot"));
            _emitter.SetChannel(_splatChannel);
        }
    }
    void Start()
    {
        _pitch = 0f;
        if (isLocalPlayer)
        {
            _camera          = Camera.allCameras[0].transform;
            _camera.position = transform.position - new Vector3(0, -0.75f, .5f);
            _camera.gameObject.GetComponent <Camera>().cullingMask &= ~(1 << LayerMask.NameToLayer("CameraInvisible"));
            _camera.SetParent(transform);
            _emitter = GetComponent <Splatter>();
            _emitter.SetEmitter(transform);
            _emitter.SetChannel(_splatChannel);
            _front = GetComponent <CharacterController>();


            //BROCK'S ADDITION THAT ALLOWS FOR PREFAB ADJUSTMENTS
            GameObject ChildGameObject1 = transform.GetChild(0).gameObject;
            GameObject ChildGameObject2 = transform.GetChild(1).gameObject;
            ChildGameObject1.SetActive(false);
            ChildGameObject2.SetActive(true);
        }
    }