예제 #1
0
        void Awake()
        {
            _StepsManager = GetComponentInParent <StepsManager>();
            //col = GetComponent<Collider>();

            if (_StepsManager == null) //If there's no  StepManager Remove the Stepss
            {
                Destroy(gameObject);
                return;
            }
            if (_StepsManager.Active == false) //If there's no  StepManager Remove the Stepss
            {
                gameObject.SetActive(false);
                return;
            }

            StepAudio = GetComponent <AudioSource>();

            if (StepAudio == null)
            {
                StepAudio = gameObject.AddComponent <AudioSource>();
            }

            StepAudio.spatialBlend = 1;  //Make the Sound 3D
            if (_StepsManager)
            {
                StepAudio.volume = _StepsManager.StepsVolume;
            }

            wait = new WaitForSeconds(WaitNextStep);
        }
예제 #2
0
        void Awake()
        {
            _StepsManager = GetComponentInParent <StepsManager>();

            StepAudio = GetComponent <AudioSource>();

            if (StepAudio == null)
            {
                StepAudio = gameObject.AddComponent <AudioSource>();
            }

            StepAudio.spatialBlend = 1;  //Make the Sound 3D
            StepAudio.volume       = volume;
        }
예제 #3
0
        void Awake()
        {
            _StepsManager = GetComponentInParent <StepsManager>();

            StepAudio = GetComponent <AudioSource>();

            if (StepAudio == null)
            {
                StepAudio = gameObject.AddComponent <AudioSource>();
            }


            StepAudio.volume = volume;
        }
예제 #4
0
        void Awake()
        {
            if (m_StepsManager == null)
            {
                m_StepsManager = transform.root.FindComponent <StepsManager>();
            }


            if (m_StepsManager == null) //If there's no  StepManager Remove the Stepss
            {
                Destroy(gameObject);
                return;
            }

            GroundLayer = m_StepsManager.GroundLayer.Value;

            if (m_StepsManager.Active == false) //If there's no  StepManager Remove the Stepss
            {
                gameObject.SetActive(false);
                return;
            }

            StepAudio = GetComponent <AudioSource>();

            if (StepAudio == null)
            {
                StepAudio = gameObject.AddComponent <AudioSource>();
            }

            StepAudio.spatialBlend = 1;  //Make the Sound 3D
            if (m_StepsManager)
            {
                StepAudio.volume = m_StepsManager.StepsVolume;
            }

            wait = new WaitForSeconds(WaitNextStep);
        }