Esempio n. 1
0
        /// <summary>
        /// 获取特效脚本
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public EffectView GetView(string name)
        {
            EffectView view = null;

            mEffects.TryGetValue(name, out view);
            return(view);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取特效
        /// </summary>
        public EffectView GetView(long id)
        {
            EffectView view = null;

            mEffects.TryGetValue(id, out view);
            return(view);
        }
    public void AddEffect(object[] data)
    {
        EffectInfo effectInfo = (EffectInfo)data[0];
        EffectView effectView = new EffectView(effectInfo);

        effectView.LoadModel();
        if (effects.ContainsKey(effectInfo.Id))
        {
            effects[effectInfo.Id] = effectView;
        }
        else
        {
            effects.Add(effectInfo.Id, effectView);
        }
    }
Esempio n. 4
0
        /// <summary>
        /// 播放一个特效
        /// </summary>
        public EffectView Create(uint effectId, Vector3 spawnPos, bool bPlaySound = true)
        {
            var data      = configMgr.GetEffectData(effectId.ToString());
            var effectObj = objMgr.Get(PoolNames.EFFECT);

            if (effectObj != null)
            {
                effectObj.transform.SetParent(battleScene.transform);
                effectObj.transform.SetLayer(Layers.Default);

                var effect = new EffectView();
                effect.Initialize(data, ++objId, spawnPos, bPlaySound);
                effectObj.AddComponent <ViewObject>().BindView(effect);
                effect.gameObject.SetActive(true);

                mEffects.Add(objId, effect);
                return(effect);
            }
            return(null);
        }
Esempio n. 5
0
 public void CollectDirtyUnit()
 {
     if (effectTempList.Count > 0)
     {
         foreach (int key in effectTempList.Keys)
         {
             EffectView effect = effectTempList[key];
             if (effect.dirtySign > 0)
             {
                 effects.Add(key, effect);
             }
             else if (effect.dirtySign < 0)
             {
                 effects.Remove(key);
                 effect.Release();
             }
             effect.dirtySign = 0;
         }
         effectTempList.Clear();
     }
 }
Esempio n. 6
0
        /// <summary>
        /// 播放一个特效
        /// </summary>
        /// <param name="name"></param>
        public EffectView Create(string name, Vector3 spawnPos)
        {
            var data      = cfgMgr.GetEffectData(name);
            var effectObj = objMgr.Get(PoolNames.EFFECT);

            if (effectObj != null)
            {
                effectObj.transform.SetParent(io.battleObject);
                effectObj.transform.SetLayer("Effect");

                var effect = new EffectView();
                effect.Initialize(data, spawnPos);
                mEffects.Add(name, effect);

                effectObj.AddComponent <ViewObject>().BindView(effect);

                effect.OnAwake();
                return(effect);
            }
            return(null);
        }
Esempio n. 7
0
        void ReleaseDesignerOutlets()
        {
            if (ContainerBottom != null)
            {
                ContainerBottom.Dispose();
                ContainerBottom = null;
            }

            if (ContainerCenterX != null)
            {
                ContainerCenterX.Dispose();
                ContainerCenterX = null;
            }

            if (ContainerCenterY != null)
            {
                ContainerCenterY.Dispose();
                ContainerCenterY = null;
            }

            if (ContainerLeading != null)
            {
                ContainerLeading.Dispose();
                ContainerLeading = null;
            }

            if (ContainerTop != null)
            {
                ContainerTop.Dispose();
                ContainerTop = null;
            }

            if (ContainerTrailing != null)
            {
                ContainerTrailing.Dispose();
                ContainerTrailing = null;
            }

            if (ContainerView != null)
            {
                ContainerView.Dispose();
                ContainerView = null;
            }

            if (EffectView != null)
            {
                EffectView.Dispose();
                EffectView = null;
            }

            if (LayoutView != null)
            {
                LayoutView.Dispose();
                LayoutView = null;
            }

            if (RootView != null)
            {
                RootView.Dispose();
                RootView = null;
            }
        }