Пример #1
0
    public virtual void Create()
    {
        if (mType == null)
        {
            Debuger.LogError(mType);

            return;
        }
        Object o = mLoad.GetObject(mResname, mType);

        if (mType == typeof(GameObject))
        {
            _gameobject = (GameObject)GameObject.Instantiate(o);
            _gameobject.name = mUrl + " " + mResname;
            _ABLoadGoMono = _gameobject.AddComponent<ABLoadGoMono>();
            _ABLoadGoMono.EnablePS = AssetBundleUti.ShowParticleSys;
        }
        else if (mType == typeof(AudioClip))
            _audioclip = (AudioClip)(o);
        else if (mType == typeof(Material))
            _mat = (Material)(o);
        else if (mType == typeof(Texture2D))
            _texture2d = (Texture2D)(o);
        else
            Debuger.LogError(mType);

        o = null;

        mCount++;
    }
Пример #2
0
        protected void Clear()
        {
            if (mObjectClips != null)
            {
                for (int i = 0; i < mObjectClips.Count; ++i)
                {
                    AudioClip res = (AudioClip)mObjectClips[i];
                    res = null;
                }
                mObjectClips.Clear();
                mObjectClips = null;
            }

            if (mObjectTexture2D != null)
            {
                for (int i = 0; i < mObjectTexture2D.Count; ++i)
                {
                    Texture2D res = (Texture2D)mObjectTexture2D[i];
                    res = null;
                }
                mObjectTexture2D.Clear();
                mObjectTexture2D = null;
            }

            if (mObjectMaterial != null)
            {
                for (int i = 0; i < mObjectMaterial.Count; ++i)
                {
                    Material res = (Material)mObjectMaterial[i];
                    res = null;
                }
                mObjectMaterial.Clear();
                mObjectMaterial = null;
            }

            if (mObject != null)
            {
                for (int i = 0; i < mObject.Count; ++i)
                {
                    GameObject res = (GameObject)mObject[i];

                    if (res != null)
                    {
                        ABLoadGoMono gomono = res.GetComponent <ABLoadGoMono>();
                        gomono.Clear();
                        GameObject.Destroy(gomono);
                        gomono = null;
                    }
                    GameObject.Destroy(res);
                    res = null;
                }
                mObject.Clear();
                mObject = null;
            }
        }
Пример #3
0
        public void EnableParticleSystems(bool enable)
        {
            for (int i = 0; i < mObject.Count; ++i)
            {
                GameObject res = (GameObject)mObject[i];

                if (res == null)
                {
                    continue;
                }

                ABLoadGoMono gomono = res.GetComponent <ABLoadGoMono>();
                gomono.EnablePS = enable;
                gomono          = null;
            }
        }
Пример #4
0
    public virtual void Create()
    {
        if (mType == null)
        {
            Debuger.LogError(mType);

            return;
        }
        Object o = mLoad.GetObject(mResname, mType);

        if (mType == typeof(GameObject))
        {
            _gameobject            = (GameObject)GameObject.Instantiate(o);
            _gameobject.name       = mUrl + " " + mResname;
            _ABLoadGoMono          = _gameobject.AddComponent <ABLoadGoMono>();
            _ABLoadGoMono.EnablePS = AssetBundleUti.ShowParticleSys;
        }
        else if (mType == typeof(AudioClip))
        {
            _audioclip = (AudioClip)(o);
        }
        else if (mType == typeof(Material))
        {
            _mat = (Material)(o);
        }
        else if (mType == typeof(Texture2D))
        {
            _texture2d = (Texture2D)(o);
        }
        else
        {
            Debuger.LogError(mType);
        }

        o = null;

        mCount++;
    }
Пример #5
0
    public virtual void Destory()
    {
        if (mLoad != null)
        {
            mLoad = null;
        }
        if (_ABLoadGoMono != null)
        {
            _ABLoadGoMono.Clear();
            GameObject.DestroyImmediate(_ABLoadGoMono);
            _ABLoadGoMono = null;
        }

        if (_gameobject != null)
        {
            _gameobject.SetActive(false);
            GameObject.DestroyImmediate(_gameobject);
            _gameobject = null;
        }
        _gameobject = null;
        _audioclip  = null;
        _mat        = null;
        _texture2d  = null;
    }
Пример #6
0
    public virtual void Destory()
    {
        if (mLoad != null)
        {
            mLoad = null;
        }
        if (_ABLoadGoMono != null)
        {
            _ABLoadGoMono.Clear();
            GameObject.DestroyImmediate(_ABLoadGoMono);
            _ABLoadGoMono = null;
        }

        if (_gameobject != null)
        {
            _gameobject.SetActive(false);
            GameObject.DestroyImmediate(_gameobject);
            _gameobject = null;
        }
        _gameobject = null;
        _audioclip  = null;
        _mat        = null;
        _texture2d  = null;
    }