Exemple #1
0
        public static bool Startup()
        {
            for (var Team = 0; Team < TeamCount; ++Team)
            {
                NpcList_[Team].Clear();
            }

            CoreNpc_ = null;

            return(true);
        }
Exemple #2
0
        public static void Shutdown()
        {
            CoreNpc_ = null;

            for (var Team = 0; Team < TeamCount; ++Team)
            {
                foreach (var Entity in NpcList_[Team])
                {
                    Entity.Dispose();
                }
                NpcList_[Team].Clear();
            }
        }
Exemple #3
0
        public static CoreNpc AddCoreNpc(string Name, Vector2 Position, float[] InitAttr)
        {
            if (CoreNpc_ != null)
            {
                return(CoreNpc_);
            }

            var Obj = AssetManager.CreatePrefabSync(new AssetUri("prefabs/npc/core/core.prefab"));

            MapManager.AddToNpcLayer(Obj.transform);
            Obj.transform.localPosition = Position;

            CoreNpc_ = new CoreNpc(Name, Obj.transform, InitAttr);
            NpcList_[(int)CombatTeam.A].Add(CoreNpc_);
            CoreNpc_.Position = Position;
            CoreNpc_.IsStatic = true;
            CoreNpc_.GetBar().SetScale(2.0f);

            EventManager.Send(new NpcAddEvent(CoreNpc_));
            return(CoreNpc_);
        }