Example #1
0
 public void OnMonsterButton()
 {
     for (int i = 0; i < SpawnableMonsters.Count; i++)
     {
         MonsterDisplay monster = content.transform.GetChild(i).GetComponent <MonsterDisplay>();
         monster.gameObject.GetComponent <Image>().color = monster.type != currentType?Color.white:color;
     }
     name.text = currentType.ToString();
     monsterSpawnPanel.UpdateSpawnPanel();
 }
Example #2
0
    public MonsterDisplay GenerateMonsterDisplay(int index)
    {
        MonsterDisplay newmonster = Instantiate <MonsterDisplay>(Prefab_monster);

        newmonster.transform.SetParent(content);
        newmonster.monsterPallete = this;

        newmonster.index  = index;
        newmonster.size   = size;
        newmonster.width  = width;
        newmonster.height = height;
        return(newmonster);
    }
Example #3
0
        /**自动行走**/
        public void autoWalk()
        {
            curStep++;
            //Log.info(this, "-autoWalk() isRoading:" + isRoading + ",curStep:" + curStep + ",pathLen:" + pathLen);
            if (isRoading == false || curStep >= pathLen)
            {
                curStep   = -1;
                isRoading = false;
                //if (battleControl != null) battleControl.isAutoRoad = false;
                //Log.info(this, "-autoWalk() 自动寻路已结束,battleControl.isAutoRoad:" + (battleControl != null ? battleControl.isAutoRoad : false) + ",battleControl:" + battleControl);
                return;
            }

            PathStepVo stepVo = pathList[curStep];
            //if (battleControl != null) battleControl.isAutoRoad = true;
            MonsterVo enemyVo;

            switch (stepVo.stepType)
            {
            case TO_STEP_NPC:
                moveTo(AppMap.Instance.GetNpc(stepVo.targetId), moveEndBack);
                break;

            case TO_STEP_SCENE:
                moveTo(AppMap.Instance.GetMapPoint(stepVo.targetId));
                break;

            case TO_STEP_WORLDMAP:
                //worldmapControl.moveTo(stepVo.targetId);
                break;

            case TO_STEP_MONSTER:
                MonsterDisplay monster = getMonsterWithUid(stepVo.targetId);
                if (monster != null)
                {
                    moveTo(monster, moveEndBack);
                }
                else
                {     //从等待队列中找
                    enemyVo = MonsterMgr.Instance.GetMonster(stepVo.targetId);
                    if (enemyVo != null)
                    {
                        (AppMap.Instance.me.Controller as MeControler).MoveToAndTellServer(enemyVo.X, enemyVo.Y, moveEndBack);
                    }
                }
                break;
            }
        }
Example #4
0
        /**创建怪物**/

        public MonsterDisplay CreateMonster(DisplayVo vo)
        {
            if (vo == null)
            {
                return(null);
            }
            vo.Type = DisplayType.MONSTER;
            var display = new MonsterDisplay();

            objectList.Add(display);
            var monsterVo = vo as MonsterVo;

            if (monsterVo != null)
            {
                vo.ClothUrl = "Model/Monster/" + monsterVo.MonsterVO.res + "/Model/BIP.assetbundle";
                UnityEngine.Debug.Log("****加载怪物BIP, BIP.assetbundle, id = ,vo.ClothUrl = " + vo.Id + ", " + vo.ClothUrl);
            }
            display.SetVo(vo);
            return(display);
        }
Example #5
0
        //boss攻击
        /// <summary>
        /// type 0 表示预警 1 表示 释放
        /// </summary>
        /// <param name="data"></param>
        private void Fun_22_11(INetData data)
        {
            WorldBossBossFightMsg_22_11 message = new WorldBossBossFightMsg_22_11();

            message.read(data.GetMemoryStream());
            if (AppMap.Instance.GetMonster().Count > 0)
            {
                MonsterDisplay monster = AppMap.Instance.GetMonster()[0];
                monster.StartShowWarningEffect(ColorConst.RedStart, ColorConst.RedEnd, 2f);
                if (message.type == 0)
                {
                    monster.Controller.SkillController.RequestUseSkill(SkillController.Attack1);
                }
                else if (message.type == 1)
                {
                    monster.Controller.SkillController.RequestUseSkill(SkillController.Attack2);
                }
            }
            Debug.Log("****Fun_22_11 播放世界Boss技能 ttype 0 表示预警 1 表示 释放: " + message.type + " boss 技能Id: " + message.skillId);
            Log.info(this, "Fun_22_11 播放世界Boss技能 ttype 0 表示预警 1 表示 释放: " + message.type + " boss 技能Id: " + message.skillId);
        }
Example #6
0
        /**移除怪物**/

        public void RemoveMonster(string id)
        {
            if (StringUtils.isEmpty(id))
            {
                return;
            }
            String mapId = AppMap.Instance.mapParser.MapId.ToString();
            //底层移除怪物display列表中对应id的信息
            MonsterDisplay monsterDisp = AppMap.Instance.GetMonster(id);

            //还原Boss脚底Buff特效
            if (MonsterType.TypeBoss == monsterDisp.MonsterVo.quality)
            {
                RemoveFootEffect();
            }
            AppMap.Instance.remove(monsterDisp);

            //移除怪物vo信息
            IList <MonsterVo> list = _monsterVoList.ContainsKey(mapId) ? _monsterVoList[mapId] : null;

            if (list == null)
            {
                return;
            }
            foreach (MonsterVo item in list)
            {
                if (item.Id.Equals(id))
                {
                    if (item.MonsterVO.quality == 3)
                    {
                        BossVo = null;
                    }
                    list.Remove(item);
                    break;
                }
            }
            BattleMode.Instance.DoMonsterDeath(); // 给服务器发送通知
        }
Example #7
0
 public void AddMonster(MonsterDisplay display)
 {
     _monsterList.Add(display);
 }