Example #1
0
    /// <summary>
    ///
    /// </summary>
    /// <returns></returns>
    static public bool CreateMainFrameTree()
    {
        EAMainFrame mainFrame = EAMainFrame.instance;

        EAFrameUtil.Call <ClockManager>(ClockManager.instance);
        EAFrameUtil.Call <SceneLoadingManager>(SceneLoadingManager.instance);
        EAFrameUtil.Call <CObjResourcePoolingManager>(CObjResourcePoolingManager.instance);
        EAFrameUtil.Call <CEffectResourcePoolingManager>(CEffectResourcePoolingManager.instance);
        EAFrameUtil.Call <UIManager>(UIManager.instance);
        EAFrameUtil.Call <EAAssetBundleLoadModule>(EAAssetBundleLoadModule.instance);
        EAFrameUtil.Call <OptionManager>(OptionManager.instance);
        EAFrameUtil.Call <SoundManager>(SoundManager.instance);

        mainFrame.gameObject.AddComponent <AudioListener>();

        mainFrame.TryPostInit();

        return(true);
    }
Example #2
0
    private void Awake()
    {
        if (m_anim == null)
        {
            m_anim = gameObject.GetComponent <Animation>();
        }

        if (soundCue == null)
        {
            soundCue = gameObject.GetComponent <SoundCue>();
        }

        if (m_anim != null)
        {
            m_anim.playAutomatically = false;
        }

        for (int i = 0; i < m_particles.Count; ++i)
        {
            ParticleSystem.MainModule main = EAFrameUtil.Call <ParticleSystem.MainModule>(m_particles[i].main);
            main.playOnAwake = false;
        }

        ParticleSystem selfparticle = gameObject.GetComponent <ParticleSystem>();

        if (selfparticle != null)
        {
            int idx = m_particles.FindIndex(x => x.GetInstanceID() == selfparticle.GetInstanceID());

            if (idx == -1)
            {
                ParticleSystem.MainModule main = EAFrameUtil.Call <ParticleSystem.MainModule>(selfparticle.main);
                main.playOnAwake = false;

                m_particles.Add(selfparticle);
            }
        }
    }