示例#1
0
        public void Tick()
        {
            try
            {
                Profiler.BeginSample("GfxSkillSystem.Tick");
                int  ct    = m_SkillLogicInfos.Count;
                long delta = (long)(Time.deltaTime * 1000 * 1000);
                for (int ix = ct - 1; ix >= 0; --ix)
                {
                    SkillLogicInfo info  = m_SkillLogicInfos[ix];
                    bool           exist = LogicSystem.ExistGameObject(info.Sender);
                    if (exist)
                    {
                        info.SkillInst.Tick(info.Sender, delta);
                    }
                    if (!exist || info.SkillInst.IsFinished)
                    {
                        if (!exist)
                        {
                            info.SkillInst.OnSkillStop(info.Sender, 0);
                        }
                        StopSkillInstance(info);
                        m_SkillLogicInfos.RemoveAt(ix);
                    }
                }

                int product_count = m_SkillProducts.Count;
                for (int i = product_count - 1; i >= 0; --i)
                {
                    ISkillProduct product = m_SkillProducts[i];
                    product.Tick(delta);
                    if (product.IsStoped())
                    {
                        m_SkillProducts.RemoveAt(i);
                    }
                }
            }
            finally
            {
                Profiler.EndSample();
            }
        }
示例#2
0
 public void AddSkillProduct(ISkillProduct product)
 {
     m_SkillProducts.Add(product);
 }