Exemple #1
0
        // Awake is called when the script instance is being loaded.
        void Awake()
        {
            for (int i = 0; i < m_audioClipTable.Length; ++i)
            {
                AudioClip clip = m_audioClipTable[i];
                if (clip == null)
                {
                    XLogger.LogWarning("AudioClipTable[" + i.ToString() + "]: Exception null reference", gameObject);
                }
            }

            if ((m_maxVolume < 0.0f) || (m_maxVolume > 1.0f))
            {
                XLogger.LogWarning("MaxVolume: Exception out of range: " + m_maxVolume.ToString(), gameObject);
            }

            m_audioSource = this.GetComponent <AudioSource>();
            XLogger.LogValidObject(m_audioSource, LibConstants.ErrorMsg.GetMsgNotBoundComponent("AudioSource"), gameObject);

            if (m_audioClipTable.Length > 0)
            {
                m_audioSource.clip = m_audioClipTable[0];
                if (m_audioSource.volume > m_maxVolume)
                {
                    m_audioSource.volume = m_maxVolume;
                }
                if (m_audioSource.playOnAwake)
                {
                    this.Play();
                }
            }
        }
Exemple #2
0
        public void Initialize()
        {
            GameObject obj = XFunctions.FindSingleObjectWithTag(LibConstants.Tag.SoundPlayer, "SEPlayer");

            XLogger.LogValidObject(obj, LibConstants.ErrorMsg.GetMsgNotFoundObject("Tag:SEPlayer"));

            m_objPlayerUnit = obj.GetComponent <SEPlayerUnit>();
            XLogger.LogValidObject(m_objPlayerUnit, LibConstants.ErrorMsg.GetMsgNotBoundComponent("SEPlayerUnit"));
        }
Exemple #3
0
        // Awake is called when the script instance is being loaded.
        void Awake()
        {
            m_pool = this.transform.FindChild("SEPool");
            XLogger.LogValidObject(m_pool, LibConstants.ErrorMsg.GetMsgNotFoundObject("SEPool"), gameObject);

            // Instance Pool
            for (int i = 0; i < m_startInstance; ++i)
            {
                XFunctions.InstanceChild(m_unit, Vector3.zero, Quaternion.identity, m_pool.gameObject);
            }
        }
Exemple #4
0
 public XUVScroller(Material material)
 {
     m_material = material;
     XLogger.LogValidObject(m_material, "Component is not bound <renderer.material>");
 }
Exemple #5
0
 // Awake is called when the script instance is being loaded.
 void Awake()
 {
     m_audioSource = this.GetComponent <AudioSource>();
     XLogger.LogValidObject(m_audioSource, LibConstants.ErrorMsg.GetMsgNotBoundComponent("AudioSource"), gameObject);
     this.gameObject.SetActive(false);
 }