Exemple #1
0
        void Start()
        {
            contAnimRef     = GetComponent <Control_Anim>();
            m_Animator      = GetComponent <Animator>();
            m_Rigidbody     = GetComponent <Rigidbody>();
            m_Capsule       = GetComponent <CapsuleCollider>();
            m_CapsuleHeight = m_Capsule.height;
            m_CapsuleCenter = m_Capsule.center;

            m_Rigidbody.constraints   = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
            m_OrigGroundCheckDistance = m_GroundCheckDistance;
        }
    private void Start()
    {
        sacoAudio.volume *= Globals.SOUND_GENERAL_SLIDER;

        this.transform.rotation.SetLookRotation(new Vector3(0, 0, 1));

        //gets de script sound
        audioPlay = GetComponent <ScriptSound>();

        m_throwArc.SetActive(false);
        m_Crosshair.SetActive(false);

        m_Camera  = Camera.main;
        oS_Camera = oS_CameraGo.GetComponent <Camera>();
        oS_CameraGo.SetActive(false);

        //animation
        anim = GetComponent <Control_Anim>();

        //Gets the Feet Script from the feet child
        feetScript = feetCollider.GetComponent <Feet>();

        //Making sure the secondary camera is off
        hideCameraRef.SetActive(false);

        //player rigidBody
        rb = this.GetComponent <Rigidbody>();

        if (playerCamera == null)
        {
            playerCamera = Camera.main.gameObject;
        }

        // get the transform of the main camera
        if (Camera.main != null)
        {
            m_Cam = Camera.main.transform;
        }

        // get the third person character ( this should never be null due to require component )
        m_Character = GetComponent <ThirdPersonCharacter>();

        m_soundManager = GameObject.FindWithTag("GameController").GetComponent <SoundManager>();

        interactionScript = playerInteractionZone.GetComponent <InteractionZone>();

        if (m_AudioSource == null)
        {
            m_AudioSource = this.GetComponent <AudioSource>();
        }
        m_AudioSource.volume *= Globals.SOUND_FX_SLIDER;
    }