Exemplo n.º 1
0
 void CheckSkillCell(ISkillCell skillCell)
 {
     if (skillCell != null)
     {
         if (skillCell is PositionCell)
         {
             canMove    = false;
             canBeBroke = false;
         }
         else if (skillCell is CompositedSkillCell)
         {
             compositedSkillCell = skillCell as CompositedSkillCell;
         }
     }
 }
Exemplo n.º 2
0
        // Use this for initialization
        void Start()
        {
            IsOver = false;
            CancelInvoke("Start");

            if (m_onlyShowSkillScope)
            {
                return;
            }

            m_AttackList.Clear();
            compositedSkillCell = null;

            ShowBossSkillWarning();

            SkillClassDisplayDesc skillClass =
                m_gameDBMgr.GetSkillClassDisplayDesc(m_skillDesc.Get <int>("skillDisplayID"));

            if (skillClass == null)
            {
                Debug.LogError("===skillClass== is null===");
                return;
            }
            if (null != m_skilleffect && m_skilleffect.Get <int>("range") == (int)SkillRangeType.SKILL_TARGET)
            {
                m_bIsAoe = false;
            }

            if (skillClass.prepareStage == null || skillClass.prepareStage.open == false)
            {
                //直接进入释放技能阶段
                CastSkill();
                return;
            }

            //吟唱阶段
            bool isLocal = false;

            if (m_actor is PlayerObj || m_actor is PetObj)
            {
                isLocal = true;
            }
            for (int i = 0; i < skillClass.prepareStageDataList.Count; ++i)
            {
                if (null != m_actor && !isLocal)
                {
                    if (skillClass.prepareStageDataList[i] is MovePosAttackDesc)
                    {
                        continue;
                    }
                }

                //GameObject cellObj = Instantiate(
                //    CoreEntry.gResLoader.LoadResource(skillClass.prepareStageDataList[i].prefabPath)) as GameObject;
                GameObject cellObj = CoreEntry.gGameObjPoolMgr.InstantiateSkillCell(skillClass.prepareStageDataList[i].prefabPath);
                cellObj.transform.parent = transform;

                ISkillCell skillCell = cellObj.GetComponent <ISkillCell>();

                skillCell.Init(skillClass.prepareStageDataList[i], this);
                skillCell.SetAoeState(m_bIsAoe);

                AddSkillCell(cellObj);
            }

            if (skillClass.prepareStage.isLookAtTarget)
            {
                InvokeRepeating("AutoLookatTarget", 0f, 0.1f);
            }

            m_prepareKeepTime = skillClass.prepareStage.keepTime;

            //吟唱结束,进入释放阶段
            Invoke("CastSkill", skillClass.prepareStage.keepTime);
            Syncm_transform();
        }