コード例 #1
0
ファイル: WarFactory.cs プロジェクト: PenpenLi/abcabcabc.mg
        public GameObject CreateCasern(UnitData unitData)
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.Unit_Build_Casern);
            GameObject go     = GameObject.Instantiate(prefab);

            go.name = go.name.Replace("(Clone)", "") + "_" + unitData.id;
            go.AddEComponent(unitData);

            // TODO NewWar
//			LevelData levelData = new LevelData();
//			levelData.buildConfig = War.model.GetBuildConfig(BuildType.Casern);

            ProduceData produceData = new ProduceData();
            SendArmData sendArmData = new SendArmData();

//			go.AddEComponent(levelData);
            go.AddEComponent(produceData);
            go.AddEComponent(sendArmData);


            unitData.Init();

            if (unitData.legionData.produceLimit)
            {
                produceData.produceLimitNum = unitData.hp;
            }

            go.transform.SetParent(War.scene.rootCaserns);
            go.transform.position = unitData.position;
            go.SetActive(true);
            return(go);
        }
コード例 #2
0
        public int effectBuildCantSendSoldierStart(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            //播放技能特效
            if (effectParameter.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectParameter.effect.animPathStart.ToLower());
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);

                int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                effectAnim.transform.position = fromPos;
                effectParameter.waitTime      = 0.5f;
            }

            foreach (UnitCtl unit in effectParameter.unitCtlList)
            {
                if (unit == null)
                {
                    continue;
                }
                BuildSkillDots skillDots = unit.GetComponent <BuildSkillDots>();
                if (skillDots != null)
                {
                    skillDots.buildStopSendsoldier(effectParameter);
                }
            }

            Debug.Log(string.Format("<color=yellow> effectBuildCantSendSoldierStart all effid={0} time={1} count={2}</color>",
                                    effectParameter.effect.id, effectParameter.effect.time, effectParameter.unitCtlList.Count));

            ////处理技能2
            // War.skillWarManager.StartCoroutine(useSkill2Effect(skillParameter, 1.0f));
            return(0);
        }
コード例 #3
0
        IEnumerator effectBuildReplaceEnd(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            yield return(new WaitForSeconds(effectParameter.waitTime));

            foreach (UnitCtl unit in effectParameter.unitCtlList)
            {
                Debug.Log("=======" + effectParameter.effect.buffAnimPath);
                int lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                if (lengion != unit.unitData.legionId)
                {
                    continue;
                }
                if (effectParameter.effect.buffAnimPath != "temp")
                {
                    GameObject effectPrefab = WarRes.GetPrefab(effectParameter.effect.buffAnimPath);
                    GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                    effectAnim.transform.position = unit.transform.position;
                }

                if (unit.unitData.buildConfig.id == effectParameter.value)
                {
//					unit.unitData.BuildSkillUplevel();
                }
                else
                {
                    unit.BuildChangeBuildConfig((int)effectParameter.value);
                }

                unit.unitData.BuildSkillCostHP(effectParameter.effect.costHP);
                unit.unitData.BuildSkillCostHPPer(effectParameter.effect.costHPPer);
                Debug.Log(string.Format("<color=yellow> effectBuildReplaceStart to {0}  </color>",
                                        unit.unitData.id));
            }
        }
コード例 #4
0
        public int changeAttribute(SkillParameter skillParameter, EffectParameter effectParameter)
        {
            //SkillWarConf skillWarConf = War.model.GetSkillWarConf(skillParameter.skillId);
            Debug.Log("changeAttribute=========" + effectParameter.effect.animPathStart + "++++++: " + effectParameter.effect.animPathEnd);
            //播放技能特效
            if (effectParameter.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectParameter.effect.animPathStart);
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);

                int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                effectAnim.transform.position = fromPos;
            }

            foreach (UnitCtl unit in effectParameter.unitCtlList)
            {
                if (unit == null)
                {
                    continue;
                }
                BuildSkillDots skillDots = unit.GetComponent <BuildSkillDots>();
                if (skillDots != null)
                {
                    skillDots.buildChangeAttri(effectParameter);
                }
            }

            Debug.Log(string.Format("<color=yellow> addAttribute all skill id={0} effid={1}</color>", skillParameter.skillId, effectParameter.effect.id));
            return(0);
        }
コード例 #5
0
        //灼烧标记
        public void buildingBurnTag(EffectParameter effectInfo)
        {
            effectParameterList.Add(effectInfo);
            UnitCtl unit = gameObject.GetComponent <UnitCtl>();

            Prop[]         props          = new Prop[] { Prop.CreateInstance(PropId.StateBurn, 1) };
            AttachPropData attachPropData = new AttachPropData(props);

            if (effectInfo.effect.buffAnimPath != "temp")
            {
                GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.buffAnimPath);
                GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                effectAnim.transform.position = unit.transform.position;
                DelayDestory destoryTimer = effectAnim.GetComponent <DelayDestory>();
                if (destoryTimer != null)
                {
                    destoryTimer.DelayTime = effectInfo.effect.time;
                }
                effectInfo.effectAnim = effectAnim;
                Debug.Log("=======destoryTimer.DelayTime: " + effectInfo.effect.time);
            }
            unit.unitData.AppProps(attachPropData, true);

            if (effectInfo.effect.time > 0)
            {
                effectInfo.waitTime = effectInfo.effect.time;
                StartCoroutine(burnTagTimer(attachPropData, effectInfo));
            }
        }
コード例 #6
0
ファイル: BBuildBehit.cs プロジェクト: PenpenLi/abcabcabc.mg
        protected override void OnStart()
        {
            base.OnStart();

            //Coo.assetManager.Load(WarRes.Effect_Fire_2, OnLoadRes);
            OnLoadRes(WarRes.Effect_Beattack, WarRes.GetPrefab(WarRes.Effect_Beattack));
        }
コード例 #7
0
        public void Instance()
        {
            MapConfig mapConfig = War.sceneData.mapConfig;

            if (mapConfig.id < 100)
            {
                meshRenderer.material.mainTexture = WarRes.GetRes <Texture2D>(mapConfig.terrain);
                meshRenderer.gameObject.SetActive(true);
                War.scene.rootTerrains.gameObject.SetActive(false);
            }
            else
            {
                GameObject prefab = WarRes.GetPrefab(mapConfig.terrain);
                GameObject go     = GameObject.Instantiate(prefab);
                go.transform.SetParent(War.scene.rootTerrains);
                go.transform.position = Vector3.zero;
                meshRenderer.gameObject.SetActive(false);
                War.scene.rootTerrains.gameObject.SetActive(true);

                Transform map = go.transform.Find("Map");
                if (map != null)
                {
                    MeshRenderer mapRenderer = map.GetComponent <MeshRenderer>();
                    if (mapRenderer != null)
                    {
                        mapRenderer.sharedMaterial.shader = Shader.Find("ihaiu/Terrain_3Texture_1Shade");
                    }
                }
            }
        }
コード例 #8
0
        public GameObject Factory()
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.Unit_Prefab_Solider);
            GameObject go     = GameObject.Instantiate(prefab);

            go.transform.SetParent(War.scene.rootSoliders);
            return(go);
        }
コード例 #9
0
ファイル: WarFactory.cs プロジェクト: PenpenLi/abcabcabc.mg
        public GameObject CreatePathGroup()
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.Unit_Prefab_UnitPathGroup);

            GameObject go = GameObject.Instantiate(prefab);

            go.transform.SetParent(War.scene.rootSoliders);
            return(go);
        }
コード例 #10
0
ファイル: WarFactory.cs プロジェクト: PenpenLi/abcabcabc.mg
        public GameObject CreateSolider(int team)
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.Unit_Prefab_Solider);

            GameObject go = GameObject.Instantiate(prefab);

            go.name = go.name.Replace("(Clone)", "") + "_" + team;
            go.transform.SetParent(War.scene.rootSoliders);
            return(go);
        }
コード例 #11
0
ファイル: BAtkRadius.cs プロジェクト: PenpenLi/abcabcabc.mg
        protected void CreateView()
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.Unit_AtkRadius);
            GameObject go     = (GameObject)GameObject.Instantiate(prefab);

            go.name = go.name.Replace("(Clone)", "-") + unitData.id;
            go.transform.SetParent(transform);
            go.transform.localPosition = Vector3.zero;
            view = go.GetComponent <AtkRadius>();
        }
コード例 #12
0
        public void Init()
        {
            if (isInit)
            {
                return;
            }
            isInit = true;

            PrefabPool pool = null;

            pool                = new PrefabPool();
            pool.cullAbove      = 100;
            pool.cullDelay      = 5;
            pool.cullMaxPerPass = 5;
            pool.manager        = this;
            pool.prefab         = WarRes.GetPrefab(WarRes.e_buffstate_movespeed_up);
            pool.group          = new GameObject("StateBuffMoveSpeedUp").transform;
            pool.group.SetParent(transform);
            stateBuffMoveSpeedUp = pool;

            pool                = new PrefabPool();
            pool.cullAbove      = 100;
            pool.cullDelay      = 5;
            pool.cullMaxPerPass = 5;
            pool.manager        = this;
            pool.prefab         = WarRes.GetPrefab(WarRes.e_buffstate_atk_up);
            pool.group          = new GameObject("StateBuffAtkUp").transform;
            pool.group.SetParent(transform);
            stateBuffAtkUp = pool;

            pool                = new PrefabPool();
            pool.cullAbove      = 100;
            pool.cullDelay      = 5;
            pool.cullMaxPerPass = 5;
            pool.manager        = this;
            pool.prefab         = WarRes.GetPrefab(WarRes.e_buffstate_producespeed_up);
            pool.group          = new GameObject("StateBuffProduceSpeedUp").transform;
            pool.group.SetParent(transform);
            stateBuffProduceSpeedUp = pool;



            pool                = new PrefabPool();
            pool.cullAbove      = 10;
            pool.cullDelay      = 5;
            pool.cullMaxPerPass = 5;
            pool.manager        = this;
            pool.prefab         = WarRes.GetPrefab(WarRes.e_spot_change);
            pool.group          = new GameObject("SpotChange").transform;
            pool.group.SetParent(transform);
            spotChange = pool;

            legionExpPool.Init(this);
        }
コード例 #13
0
        void InitClock()
        {
            GameObject go = GameObject.Instantiate <GameObject>(WarRes.GetPrefab(WarRes.WarViews_UnitClock));

            go.name = "WarViews_Clock-" + unitData.id;
            go.transform.SetParent(War.scene.rootUnitClock);
            go.transform.localScale = Vector3.one;
            clockView = go.GetComponent <ClockView>();
            clockView.Hide();
            go.GetComponent <UIFllowWorldPosition>().targetWorld = transform;
        }
コード例 #14
0
        protected void CreateEffect()
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.Effect_Uplevel);
            GameObject go     = (GameObject)GameObject.Instantiate(prefab);

            go.SetActive(false);
            go.transform.SetParent(anchorEffectUplevel);
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;
            effect = go;
        }
コード例 #15
0
        //--------------------定时伤害------------------------------

        #endregion

        #region 手动范围
        //--------------------手动范围------------------------------
        private int manualHurtRang(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.animPathStart);
                GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                effectAnim.transform.position = effectInfo.receivePos;
            }
            War.skillWarManager.StartCoroutine(manualHurtRangEnd(skillParameter, effectInfo));

            return(0);
        }
コード例 #16
0
ファイル: WarPreload.cs プロジェクト: PenpenLi/abcabcabc.mg
        protected void OnLoadRes(string name, object obj)
        {
            //Debug.Log(string.Format("<color=0x66FF44>name={0}  obj={1}</color>", name, obj));
            WarRes.AddPrefab(name, obj);

            redLoaded++;
            if (redLoaded >= resCount && isLoaded == false)
            {
                isLoaded = true;
                War.signal.PreloadComplete();
            }
        }
コード例 #17
0
        public void SetData(SkillOperateData data)
        {
            uiCamera = Coo.uiCamera;

            this.data = data;
            data.receiveList.Clear();
            skillButton.SetData(data);
            skillInfoNode.SetData(data);
            if (useEffect != null)
            {
                useEffect.SetData(data);
            }



            if (data.skillConfig.skillType == SkillType.Build_Replace)
            {
                BuildConfig buildConfig = War.model.GetBuildConfig(data.skillConfig.buildId);
                Debug.Log("data.skillId=" + data.skillId + "  data.skillConfig.buildId=" + data.skillConfig.buildId);
                string file = buildConfig.GetLevelConfig(1).avatarConfig.Model;
                Debug.Log(file);
                GameObject prefab = WarRes.GetPrefab(file);
                obj = GameObject.Instantiate(prefab);
                obj.SetActive(false);
                obj.GetComponent <SpriteRenderer>().color = new Color(0.8f, 0.8f, 0.8f, 0.8f);
                objDestory = true;
            }
            else
            {
                switch (data.skillConfig.operate)
                {
                case SkillOperateType.SelectCircle:
                    obj = GameObject.Instantiate(War.skillUse.selectCircleView.gameObject);
                    obj.SetActive(false);
                    SkillOperateSelectCircleView skillOperateSelectCircleView = obj.GetComponent <SkillOperateSelectCircleView> ();
                    skillOperateSelectCircleView.Radius   = data.skillConfig.radius;
                    skillOperateSelectCircleView.Relation = data.skillConfig.relation;
                    objDestory = true;
                    break;
                }
            }

            selectUnitMaterialType = data.skillConfig.relation.REnemy() ? WarMaterialsType.operateSelect_Enemy : WarMaterialsType.operateSelect_Own;

            if (this.data != null)
            {
                rectTransform.anchoredPosition = new Vector2(-180, 56);
                MoveToGroove();

                this.data.sSetUse += SetUse;
            }
        }
コード例 #18
0
ファイル: BShadow.cs プロジェクト: PenpenLi/abcabcabc.mg
        protected void Init()
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.Unit_Shadow);
            GameObject go     = (GameObject)GameObject.Instantiate(prefab as UnityEngine.Object);

            go.name = "War_Shadow-" + unitData.id;
            go.transform.SetParent(War.scene.rootShadow);
            shadow        = go.GetComponent <UnitShadow>();
            shadow.target = transform;
            shadow.SetPosition();

            OnChangeAvatar(unitAgent);
        }
コード例 #19
0
        void CreateHeroHead()
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.WarViews_HeroHead);
            GameObject go     = GameObject.Instantiate(prefab);

            go.name = "WarViews_HeroHead-" + heroData.heroId;
            go.transform.SetParent(War.scene.rootHeroHeads, false);
            go.transform.localScale = Vector3.one;

            heroHead = go.GetComponent <HeroHead>();
            heroHead.SetData(heroData);
            heroHead.Hide();
        }
コード例 #20
0
        IEnumerator buildHurt(UnitCtl unit, EffectParameter effectInfo)
        {
            yield return(new WaitForSeconds(0.8f));

            if (effectInfo.effect.animPathEnd != "temp")
            {
                GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.animPathEnd);
                GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                effectAnim.transform.position = unit.transform.position;
            }
            DamageVO damageVo = War.skillWarManager.GetDamageParameter(effectInfo.value, false, DamageType.ATTACK, unit, effectInfo.caster);

            unit.Damage(damageVo);
        }
コード例 #21
0
        protected void Init()
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.SendArmy);
            GameObject go     = GameObject.Instantiate(prefab);

            go.name = "War_View_SendArmy";
            go.transform.SetParent(anchorImageSendArm);
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;
            sendArmyView = go.GetComponent <SendArmyView>();

            sendArmyView.unit     = unitCtl;
            sendArmyView.units    = War.scene.buildList;
            sendArmyView.sSelect += OnSelect;
        }
コード例 #22
0
ファイル: WarFactory.cs プロジェクト: PenpenLi/abcabcabc.mg
        public GameObject CreateHero(UnitData unitData, HeroData heroData)
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.Unit_Hero);
            GameObject go     = GameObject.Instantiate(prefab);

            go.name = go.name.Replace("(Clone)", "") + "_" + unitData.legionId + "-" + heroData.heroId;
            go.AddEComponent(unitData);
            go.AddEComponent(heroData);
            unitData.Init();
            heroData.isInstance = true;

            go.transform.SetParent(War.scene.rootHeros);
            go.SetActive(true);
            return(go);
        }
コード例 #23
0
        public int stopSoldierStart(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            Debug.Log("stopSoldierStart=========" + effectInfo.effect.animPathStart + "++++++" + effectInfo.effect.animPathEnd);
            //播放技能特效
            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectInfo.effect.animPathStart.ToLower());
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);
                effectAnim.transform.position = effectInfo.receivePos;

                effectInfo.waitTime = 0.8f;
            }
            War.skillWarManager.StartCoroutine(stopSoldierEnd(skillParameter, effectInfo));
            return(0);
        }
コード例 #24
0
ファイル: War.cs プロジェクト: PenpenLi/abcabcabc.mg
 public static void Exit(bool isHandler)
 {
     LuaCallMethod("Exit", isHandler, sceneData.id);
     // 战斗流程状态
     War.processState = WarProcessState.Exit;
     // 关闭战斗结束面板
     Coo.menuManager.CloseMenu(CC.Module.Menu.MenuType.BattleEnd);
     // 播放
     War.Play();
     // 退出战斗 进入主场景
     Coo.menuManager.OpenMenu(MenuType.MainScene, 1);
     // 销毁战斗加载的资源
     WarRes.Destroy();
     War.Instance.Destory();
 }
コード例 #25
0
ファイル: WarFactory.cs プロジェクト: PenpenLi/abcabcabc.mg
        public GameObject CreateWall(UnitData unitData)
        {
            GameObject prefab = WarRes.GetPrefab(WarRes.Unit_Wall);

            GameObject go = GameObject.Instantiate(prefab);

            go.name = go.name.Replace("(Clone)", "") + "_" + unitData.id;
            go.AddEComponent(unitData);

            unitData.Init();

            go.transform.SetParent(War.scene.rootWalls);
            go.transform.position = unitData.position;
            go.SetActive(true);
            return(go);
        }
コード例 #26
0
        IEnumerator autoHurtSoilderEnd(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            yield return(new WaitForSeconds(effectInfo.waitTime));

            SkillWarConf skillWarConf = War.model.GetSkillWarConf(skillParameter.skillId);

            //播放技能,针对所有出征士兵
            int unitType = 0;

            unitType = unitType.USolider(true);
            int relation = 0;

            relation = relation.REnemy(true);
            List <UnitCtl> unitSoldierList = War.scene.SearchUnit(unitType, effectInfo.caster.unitData.legionId, relation);

            foreach (UnitCtl unit in unitSoldierList)
            {
                if (unit == null)
                {
                    continue;
                }
                if (effectInfo.effect.animPathEnd != "temp")
                {
                    GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.animPathEnd.ToLower());
                    GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                    effectAnim.transform.position = unit.transform.position;
                }
            }

            foreach (UnitCtl unit in effectInfo.unitCtlList)
            {
                if (unit == null)
                {
                    continue;
                }
                unit.DamageToDeath(effectInfo.caster);
            }


            Debug.Log(string.Format("<color=yellow> autoHurtSoilder=id:{0} {1}</color>",
                                    skillParameter.skillId, effectInfo.unitCtlList.Count));
            //处理技能2
            if (skillParameter.curDealSkillIdx == 1)
            {
                War.skillWarManager.dealSkill2Effect(skillParameter);
            }
        }
コード例 #27
0
        //==================伤害出征士兵 冰冻效果=========================
        private int autoHurtSoilderStart(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            Debug.Log("=========" + effectInfo.effect.animPathStart + "++++++" + effectInfo.effect.animPathEnd);
            //播放技能特效
            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectInfo.effect.animPathStart.ToLower());
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);

                int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                effectAnim.transform.position = fromPos;
                effectInfo.waitTime           = 0.8f;
            }
            War.skillWarManager.StartCoroutine(autoHurtSoilderEnd(skillParameter, effectInfo));
            return(0);
        }
コード例 #28
0
        public int effectBuildReplaceStart(SkillParameter skillParameter, EffectParameter effectInfo)
        {
            //播放技能特效
            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefabSelf = WarRes.GetPrefab(effectInfo.effect.animPathStart.ToLower());
                GameObject effectAnim       = GameObject.Instantiate <GameObject>(effectPrefabSelf);

                int     lengion = War.skillWarManager.getLegionByHeroUid(skillParameter.curHeroUid);
                Vector3 fromPos = War.scene.GetLegionPosition(lengion);
                effectAnim.transform.position = fromPos;
                effectInfo.waitTime           = 0.5f;
            }
            War.skillWarManager.setBuildHeroInfo(skillParameter, effectInfo);
            War.skillWarManager.StartCoroutine(effectBuildReplaceEnd(skillParameter, effectInfo));
            return(0);
        }
コード例 #29
0
        //单个技能效果
        IEnumerator effectHurtSingleStart(SkillParameter skillParameter, EffectParameter effectInfo, UnitCtl unit, bool needDealSkill2)
        {
            float idxRand = Random.Range(0.0f, 1.0f);

            //Debug.LogFormat("=====idxRand:{0}", idxRand);
            yield return(new WaitForSeconds(idxRand));

            SkillWarConf skillWarConf = War.model.GetSkillWarConf(skillParameter.skillId);

            if (effectInfo.effect.animPathStart != "temp")
            {
                GameObject effectPrefab = WarRes.GetPrefab(effectInfo.effect.animPathStart);
                GameObject effectAnim   = GameObject.Instantiate <GameObject>(effectPrefab);
                effectAnim.transform.position = unit.transform.position;
                effectInfo.waitTime           = 0.2f;
            }

            War.skillWarManager.StartCoroutine(autoHurtBuildSingleEnd(skillParameter, effectInfo, unit, needDealSkill2));
        }
コード例 #30
0
        public void ExeAtk(UnitCtl target)
        {
            target.unitData.isTurretHit = true;

            GameObject prefab = WarRes.GetPrefab(WarRes.Turret_Fx_Projectile);
            GameObject go     = GameObject.Instantiate <GameObject>(prefab);

            go.transform.position = transform.position + Vector3.up * 3f;
            TurretProjectile projectile = go.AddComponent <TurretProjectile>();

            projectile.curveType          = ProjectType.Line;
            projectile.duration           = unitData.attackSpeed * 0.5f;
            projectile.targetTransform    = target.transform;
            projectile.explosionPrefab    = WarRes.GetPrefab(WarRes.Turret_Fx_Explosion);
            projectile.completeArg        = target;
            projectile.OnCompleteHandler += OnProjectileComplete;

            War.signal.DoTurretAtk(unitCtl.unitData.uid, target.unitData.uid);
        }