コード例 #1
0
ファイル: SoundManager.cs プロジェクト: tuita520/u3dmmorpg
    ////////////////////////////////////方法实现//////////////////////////////////////////

    private void Awake()
    {
#if !UNITY_EDITOR
        try
        {
#endif

        for (var i = 0; i < mSFXChannelsCount; ++i)
        {
            mSFXChannel[i]               = new MyAudioSource();
            mSFXChannel[i].m_uID         = -1;
            mSFXChannel[i].m_AudioSource = gameObject.AddComponent <AudioSource>();
        }
        mBGAudioSource.m_AudioSource = gameObject.AddComponent <AudioSource>();
        mBGAudioSource.m_uID         = -1;
        mSoundClipPools = new SoundClipPools();

#if !UNITY_EDITOR
    }

    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }
コード例 #2
0
    ////////////////////////////////////·½·¨ÊµÏÖ//////////////////////////////////////////

    void Awake()
    {
        DontDestroyOnLoad(this.gameObject);

        for (int i = 0; i < m_SFXChannelsCount; ++i)
        {
            m_SFXChannel[i]               = new MyAudioSource();
            m_SFXChannel[i].m_uID         = -1;
            m_SFXChannel[i].m_AudioSource = gameObject.AddComponent <AudioSource>() as AudioSource;
        }
        m_BGAudioSource.m_AudioSource = gameObject.AddComponent <AudioSource>() as AudioSource;
        m_BGAudioSource.m_uID         = -1;
        m_SoundClipPools = new SoundClipPools();
    }
コード例 #3
0
    static int set_mSoundClipPools(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SoundManager   obj  = (SoundManager)o;
            SoundClipPools arg0 = (SoundClipPools)ToLua.CheckObject(L, 2, typeof(SoundClipPools));
            obj.mSoundClipPools = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index mSoundClipPools on a nil value" : e.Message));
        }
    }
コード例 #4
0
    static int get_mSoundClipPools(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            SoundManager   obj = (SoundManager)o;
            SoundClipPools ret = obj.mSoundClipPools;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index mSoundClipPools on a nil value" : e.Message));
        }
    }