Beispiel #1
0
        /// <summary>
        /// Cache the component references.
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            m_Rigidbody  = GetComponent <Rigidbody>();
            m_ShortClimb = GetComponent <ShortClimb>();
        }
Beispiel #2
0
        /// <summary>
        /// Cache the component references and initialize the default values.
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            m_Rigidbody  = GetComponent <Rigidbody>();
            m_ShortClimb = GetComponent <ShortClimb>();

            // Populate the ParticleSystem and AudioSource arrays.
            if (m_SplashGameObjects.Length > 0)
            {
                m_SplashParticleSystems = new ParticleSystem[m_SplashGameObjects.Length];
                m_SplashAudioSources    = new AudioSource[m_SplashGameObjects.Length];
                for (int i = 0; i < m_SplashGameObjects.Length; ++i)
                {
                    m_SplashParticleSystems[i] = m_SplashGameObjects[i].GetComponent <ParticleSystem>();
                    m_SplashAudioSources[i]    = m_SplashGameObjects[i].GetComponent <AudioSource>();
                }
            }
        }