Exemplo n.º 1
0
        // Use this for initialization
        void Start()
        {
            CancelInvoke("Start");
            //m_skillBase = this.transform.root.gameObject.GetComponent<SkillBase>();
            if (m_skillBase == null || m_skillBase.m_actor == null)
            {
                return;
            }

            if (m_skillBase.m_onlyShowSkillScope)
            {
                return;
            }

            m_transform = m_skillBase.m_actor.transform;

            //Configs.skillConfig skillDesc = m_skillBase.m_actor.GetCurSkillDesc(m_skillBase.m_skillID);
            //m_skillClass = m_gameDBMgr.GetSkillClassDisplayDesc(skillDesc.iID);

            //吟唱后,发射子弹
            float curTime = m_skillBase.GetCurActionTime();

            if (m_fireFlyAttackDesc.fireTime <= curTime)
            {
                Fire();
            }
            else
            {
                Invoke("Fire", m_fireFlyAttackDesc.fireTime - curTime);
            }
        }
Exemplo n.º 2
0
        // Use this for initialization
        void Start()
        {
            CancelInvoke("Start");
            if (m_skillBase == null || m_skillBase.m_actor == null)
            {
                return;
            }

            //伤害计算
            m_transform = m_skillBase.transform;


            float hitTime = m_oneDamageInfo.hitTime / m_skillBase.m_speed;

            float delayTime = m_oneDamageInfo.hitTime;

            float curTime = m_skillBase.GetCurActionTime();

            if (curTime >= hitTime)
            {
                CalculateDamage();
            }
            else
            {
                //delayTime = hitTime - curTime;
                Invoke("CalculateDamage", delayTime);
            }

            if (m_oneDamageInfo.isRepeatedly)
            {
                //Invoke("EndDamage", endTime);
            }
        }
Exemplo n.º 3
0
        // Use this for initialization
        void Start()
        {
            CancelInvoke("Start");

            ////伤害计算
            //m_skillBase = this.transform.root.gameObject.GetComponent<SkillBase>();

            if (m_skillBase == null || m_skillBase.m_actor == null)
            {
                return;
            }

            if (m_collideDamage == null)
            {
                return;
            }

            float curActionTime = m_skillBase.GetCurActionTime();
            float diffTime      = m_collideDamage.endCarryOffTargetTime - curActionTime;

            if (diffTime > 0)
            {
                Invoke("EndCarryOffTarget", diffTime);
            }

            RegisterEvent();
        }
Exemplo n.º 4
0
        // Use this for initialization
        void Start()
        {
            CancelInvoke("Start");

            if (m_skillBase == null || m_skillBase.m_actor == null)
            {
                return;
            }

            //m_isHadLoadFrameStop = false;

            //伤害计算
            //m_skillBase = this.transform.root.gameObject.GetComponent<SkillBase>();
            m_transform = m_skillBase.transform;



            float hitTime = m_oneDamageInfo.hitTime / m_skillBase.m_speed;

            float delayTime = m_oneDamageInfo.hitTime;

            float curTime = m_skillBase.GetCurActionTime();

            if (curTime >= hitTime)
            {
                CalculateDamage();
            }
            else
            {
                //delayTime = hitTime - curTime;
                Invoke("CalculateDamage", delayTime);
            }

            if (m_oneDamageInfo.isRepeatedly)
            {
                //Invoke("EndDamage", endTime);
            }
        }
Exemplo n.º 5
0
        public override void Init(ISkillCellData cellData, SkillBase skillBase)
        {
            m_skillBase = skillBase;
            cellDesc    = (PositionCellDesc)cellData;

            skillBase.ShouldUpdatePositionToCastObj = false;

            orgPos          = m_skillBase.m_actor.transform.position;
            orgFront        = m_skillBase.m_actor.transform.forward;
            orgRight        = m_skillBase.m_actor.transform.right;
            targetTransform = null;

            if (cellDesc != null)
            {
                //有对应的行为技能ID
                if (cellDesc.BehaviorSkillId > 0)
                {
                    behaviorSkillDesc = skillBase.m_actor.GetCurSkillDesc(cellDesc.BehaviorSkillId);
                    if (behaviorSkillDesc != null)
                    {
                        ActorObj targetActorBase = skillBase.m_actor.GetTargetFromSelector(behaviorSkillDesc, null);
                        if (targetActorBase != null)
                        {
                            targetTransform = targetActorBase.transform;
                        }
                    }
                }
                else
                {
                    //默认技能行为
                    if (skillBase.m_hitActor != null)
                    {
                        targetTransform = skillBase.m_hitActor.transform;
                    }
                }

                //是否attach到actor上
                if (cellDesc.AttachToActor)
                {
                    if (cellDesc.SyncRotation)
                    {
                        skillBase.transform.parent = targetTransform;
                        BaseTool.ResetTransform(skillBase.transform);
                        skillBase.transform.localPosition += cellDesc.AttachOffset;
                    }
                    else
                    {
                        SyncPosition();
                        BaseTool.SetLocalPosition(m_skillBase.transform, curMovingPos);
                    }
                }
                else
                {
                    //走相应的轨迹
                    if (cellDesc.PointList.Count > 0)
                    {
                        BaseTool.SetPosition(skillBase.transform, GetPos(0));
                        skillBase.transform.forward = skillBase.transform.forward;
                        currentIndex = 0;
                    }
                }

                //同步施法者位置
                if (cellDesc.SyncOwnerPosition)
                {
                    BaseTool.SetPosition(m_skillBase.m_actor.transform, skillBase.transform.position);
                }

                Reset();

                if (cellDesc.DelayMovingTime >= 0)
                {
                    //吟唱后,发射子弹
                    float curTime = m_skillBase.GetCurActionTime();

                    if (cellDesc.DelayMovingTime <= curTime)
                    {
                        StartToMove();
                    }
                    else
                    {
                        Invoke("StartToMove", cellDesc.DelayMovingTime - curTime);
                    }
                }
            }
        }
Exemplo n.º 6
0
        // Use this for initialization
        void Start()
        {
            CancelInvoke("Start");

            if (m_skillBase == null || m_skillBase.m_actor == null)
            {
                return;
            }

            m_isHadLoadFrameStop = false;

            //yy test
            //LuaTable desc =  ConfigManager.Instance.Skill.GetSkillConfig( m_skillBase.m_skillID ) ;

            ////伤害计算
            //m_skillBase = this.transform.root.gameObject.GetComponent<SkillBase>();

            if (m_skillBase.m_onlyShowSkillScope)
            {
                return;
            }

            //gamedb.SkillDesc skillDesc = m_skillBase.m_actor.GetCurSkillDesc(m_skillBase.m_skillID);
            //SkillClassDisplayDesc skillClass = m_gameDBMgr.GetSkillClassDisplayDesc(m_skillBase.m_skillID);

            //if (skillClass.damageList.Count <= m_dataIndex)
            //{
            //    return;
            //}

            //m_oneDamageInfo = skillDesc.astDamageCellArray[m_dataIndex];
            //m_oneDamageInfo = skillClass.damageList[m_dataIndex];
            if (m_oneDamageInfo == null)
            {
                return;
            }

            m_repeateKeep = m_oneDamageInfo.keepTime;

            float hitTime = m_oneDamageInfo.hitTime / m_skillBase.m_speed;

            //float endTime = (m_oneDamageInfo.keepTime * m_oneDamageInfo.damageDiff) / m_skillBase.m_speed;

            float delayTime = 0;

            float curTime = m_skillBase.GetCurActionTime();

            //if (desc.attackAction.Length <1 )
            // {
            //    curTime = 0;
            //}


            //LogMgr.UnityLog("hitTime=" + hitTime + ", curTime=" + curTime + ", skillid=" + m_skillBase.m_skillID);

            if (m_skillBase.SkillOverTime < hitTime)
            {
                LogMgr.UnityError(string.Format("技能结束时间:{0} < 打击时间:{1} , 将引发释放不出来 的BUG  skillID:{2}", m_skillBase.SkillOverTime, hitTime, m_skillBase.m_skillID));
            }


            if (curTime >= hitTime)
            {
                CalculateDamage();
                LogMgr.UnityLog("----curTime:" + curTime + "     hitTime:" + hitTime);
            }
            else
            {
                delayTime = hitTime - curTime;
                Invoke("CalculateDamage", delayTime);
            }

            if (m_oneDamageInfo.isRepeatedly)
            {
                //Invoke("EndDamage", endTime);
            }
        }