Exemplo n.º 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();
            }
        }
Exemplo n.º 2
0
        public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
        {
            if (curSectionTime < m_StartTime)
            {
                return(true);
            }
            if (curSectionTime > (m_StartTime + m_RemainTime))
            {
                return(false);
            }
            UnityEngine.GameObject obj = sender as UnityEngine.GameObject;
            if (obj == null)
            {
                return(false);
            }
            GameObjectBox gob = instance.CustomDatas.GetData <GameObjectBox>();

            if (gob != null && LogicSystem.ExistGameObject(gob.MyGameObject))
            {
                UnityEngine.Vector3 dir = gob.MyGameObject.transform.position - obj.transform.position;
                GfxSkillSystem.ChangeAllDir(obj, (float)Math.Atan2(dir.x, dir.z));
            }
            return(true);
        }