Exemple #1
0
    void CreatMonster()
    {
        isCreatMonster = false;
        if (spwanList.Count < (monster.Length))
        {
            int          count = (monster.Length) - spwanList.Count;
            SpawnMonster sm    = null;
            for (int i = 0; i < count; i++)
            {
                sm = Instantiate <SpawnMonster>(Spawan);
                sm.OnCreatMonster += (GameObject go, CharacterData cd) =>
                {
                    if (go.GetComponent <Monster_AI>())
                    {
                        go.GetComponent <Monster_AI>().targetCs = player;
                    }
                    if (go.GetComponent <CharacterState>())
                    {
                        go.GetComponent <CharacterState>().CharData.attrNode.field_distance *= 100;
                    }

                    //AddCs(go.GetComponent<CharacterState>());
                };
                sm.transform.parent = transform;
                if (!spwanList.Contains(sm))
                {
                    spwanList.Add(sm);
                }
            }
        }
        else if (spwanList.Count > (monster.Length))
        {
            int count     = spwanList.Count - (monster.Length);
            int needCount = spwanList.Count - count;
            for (int i = spwanList.Count - 1; i > needCount; i--)
            {
                spwanList.Remove(spwanList[i]);
            }
        }

        object[] monsterDatas = null;
        for (int i = 0; i < (monster.Length); i++)
        {
            if (monster[i] is int[])
            {
                int[] mons = monster[i] as int[];
                monsterDatas = new object[mons.Length];
                for (int j = 0; j < mons.Length; j++)
                {
                    monsterDatas[j] = mons[j];
                }
            }
            else
            {
                monsterDatas = monster[i] as object[];
            }
            spwanList[i].transform.position = RandomPos(spwanList[i].transform);
            spwanList[i].PropCreatMonster((int)monsterDatas[0], float.Parse(monsterDatas[1].ToString()), float.Parse(monsterDatas[2].ToString()), 1);
        }
    }
Exemple #2
0
 void CheckMonsterList(object[] mon, SpawnMonster sm)
 {
     if (null != mon && mon.Length > 0)
     {
         WellenBS(mon, sm);
     }
 }
Exemple #3
0
    public void TriggerBoss()
    {
        if (CharacterManager.playerCS == null || CharacterManager.playerCS.isDie)
        {
            return;
        }
        mShouldTimer = false;
        skinned      = CharacterManager.playerCS.GetComponentsInChildren <SkinnedMeshRenderer>();
        if (bossobj != null)
        {
            bossSpawnMonster = bossobj.GetComponent <SpawnMonster>();
            spawnQueue       = bossSpawnMonster.spawnQueue;
        }
        mCurSceneNode = FSDataNodeTable <SceneNode> .GetSingleton().FindDataByType(GameLibrary.dungeonId);

        if (isKV && cart.GetComponent <BullockCarts>())
        {
            cart.GetComponent <BullockCarts>().isMove = false;
        }
        GetComponent <BoxCollider>().enabled = false;
        if (isWarning && null != bossobj)
        {
            SceneUIManager.instance.bossWarning.ShowWarning(warningTime);
        }

        if (mCurSceneNode.needAnimation == 1)
        {
            //摄像机直推的动作
            PlayEntranceAnimation();
            //CD停止
            CDTimer.GetInstance().CDRunOrStop(false);
        }
        else if (mCurSceneNode.needAnimation == 2)
        {
            //模型出场动画加上摄像机动画
            PlaySpecialAnimation();
            //CD停止
            CDTimer.GetInstance().CDRunOrStop(false);
        }
        else if (mCurSceneNode.needAnimation == 3)
        {
            MonsterData mCurMonsterData = new MonsterData(spawnQueue);
            ShowBoos(mCurMonsterData);
            //CD停止
            CDTimer.GetInstance().CDRunOrStop(false);
        }
        else
        {
            Invoke("ShowBossSpawn", warningTime);
        }
    }
Exemple #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="script">Script handle</param>
        /// <param name="dungeon">Dungeon handle</param>
        public SpawnMonsterControl(SpawnMonster script, Dungeon dungeon)
        {
            InitializeComponent();


            Action = script ?? new SpawnMonster();

            TargetBox.Dungeon = dungeon;
            TargetBox.SetTarget(script.Target);

            MonsterNameBox.Items.AddRange(ResourceManager.GetAssets <Monster>().ToArray());
            if (!string.IsNullOrEmpty(SpawnScript.MonsterName))
            {
                MonsterNameBox.SelectedItem = SpawnScript.MonsterName;
            }
        }
Exemple #5
0
    void SummonMonster()
    {
        _smlist.Clear();

        for (int i = 0; i < 3; i++)
        {
            GameObject monster = new GameObject();
            monster.name             = "SummonMonster";
            monster.transform.parent = transform.parent;
            SpawnMonster _sm = UnityUtil.AddComponetIfNull <SpawnMonster>(monster);
            _smlist.Add(_sm);
        }



        InvokeRepeating("CreatMonster", 0, 0.2f);
    }
    public MonsterBase GetMonster(SpawnMonster type)
    {
        foreach (MonsterBase m in _monsters[type])
        {
            if (m == null)
            {
                continue;
            }

            if (!m.gameObject.activeInHierarchy)
            {
                m.gameObject.SetActive(true);
                return(m);
            }
        }

        MonsterBase createMon = CreateMonster(type);

        createMon.gameObject.SetActive(true);

        return(createMon);
    }
    private MonsterBase CreateMonster(SpawnMonster type)
    {
        GameObject  monObj = null;
        MonsterBase mon    = null;

        monObj = Instantiate(_monsterRcs[(int)type]) as GameObject;
        monObj.SetActive(false);
        monObj.transform.parent   = transform;
        monObj.transform.position = Vector3.zero;

        mon = monObj.GetComponent <MonsterBase>();

        switch (type)
        {
        case SpawnMonster.GuardMushroom:
            _guards.Add(mon);
            break;

        case SpawnMonster.QueenMushroom:
            _queens.Add(mon);
            break;
        }
        return(mon);
    }
        private void NotifyMonsterSpawned(IMonster m)
        {
            var sp = new SpawnMonster(_navGrid, m);

            _packetHandlerManager.BroadcastPacketVision(m, sp, Channel.CHL_S2C);
        }
Exemple #9
0
        private void notifyMonsterSpawned(Monster m)
        {
            var sp = new SpawnMonster(m);

            _game.PacketHandlerManager.broadcastPacketVision(m, sp, Channel.CHL_S2C);
        }
Exemple #10
0
        /// <summary>
        /// Loads a party
        /// </summary>
        /// <param name="filename">Xml data</param>
        /// <returns>True if team successfuly loaded, otherwise false</returns>
        public virtual bool Load(XmlNode xml)
        {
            if (xml == null)
            {
                return(false);
            }


            Action = null;

            switch (xml.Name)
            {
            case SpawnMonster.Tag:
            {
                Action = new SpawnMonster();
            }
            break;

            case EnableTarget.Tag:
            {
                Action = new EnableTarget();
            }
            break;

            case DisableTarget.Tag:
            {
                Action = new DisableTarget();
            }
            break;

            case ActivateTarget.Tag:
            {
                Action = new ActivateTarget();
            }
            break;

            case DeactivateTarget.Tag:
            {
                Action = new DeactivateTarget();
            }
            break;

            case ChangePicture.Tag:
            {
                Action = new ChangePicture();
            }
            break;

            case ChangeText.Tag:
            {
                Action = new ChangeText();
            }
            break;

            case DisableChoice.Tag:
            {
                Action = new DisableChoice();
            }
            break;

            case EnableChoice.Tag:
            {
                Action = new EnableChoice();
            }
            break;

            case EndChoice.Tag:
            {
                Action = new EndChoice();
            }
            break;

            case EndDialog.Tag:
            {
                Action = new EndDialog();
            }
            break;

            case GiveExperience.Tag:
            {
                Action = new GiveExperience();
            }
            break;

            case GiveItem.Tag:
            {
                Action = new GiveItem();
            }
            break;

            case Healing.Tag:
            {
                Action = new Healing();
            }
            break;

            case JoinCharacter.Tag:
            {
                Action = new JoinCharacter();
            }
            break;

            case PlaySound.Tag:
            {
                Action = new PlaySound();
            }
            break;

            case SetTo.Tag:
            {
                Action = new SetTo();
            }
            break;

            case Teleport.Tag:
            {
                Action = new Teleport();
            }
            break;

            case ToggleTarget.Tag:
            {
                Action = new ToggleTarget();
            }
            break;

            case DisplayMessage.Tag:
            {
                Action = new DisplayMessage();
            }
            break;

            default:
            {
                Trace.WriteLine("[ScriptBase] Load() : Unknown node \"" + xml.Name + "\" found.");
                return(false);
            }
            }

            if (Action == null)
            {
                return(false);
            }


            Action.Load(xml);

            return(true);
        }
Exemple #11
0
        private static void notifyMonsterSpawned(Monster m)
        {
            var sp = new SpawnMonster(m);

            PacketHandlerManager.getInstace().broadcastPacketVision(m, sp, Channel.CHL_S2C);
        }
Exemple #12
0
        GameObject SpawnActor(SpawnMonster spawnInfo)
        {
            GameObject obj = null;

            return(obj);
        }
Exemple #13
0
 void WellenBS(object[] id, SpawnMonster sm)
 {
     sm.SetMonsterPoint(id, false, Interval);
 }