예제 #1
0
파일: PetComponent.cs 프로젝트: aoehuge/ET
        public override void Dispose()
        {
            if (this.IsDisposed)
            {
                return;
            }
            base.Dispose();

            foreach (Pet pet in this.idPets.Values)
            {
                pet.Dispose();
            }

            this.idPets.Clear();

            Instance = null;
        }
예제 #2
0
파일: PetFactory.cs 프로젝트: aoehuge/ET
        public static Pet Create(Entity domain, long id)
        {
            ResourcesComponent resourcesComponent = Game.Scene.GetComponent <ResourcesComponent>();
            GameObject         bundleGameObject   = (GameObject)resourcesComponent.GetAsset("Unit.unity3d", "Unit");
            GameObject         prefab             = bundleGameObject.Get <GameObject>("Skeleton");

            PetComponent petComponent = Game.Scene.GetComponent <PetComponent>();

            GameObject go  = UnityEngine.Object.Instantiate(prefab);
            Pet        pet = EntityFactory.CreateWithId <Pet, GameObject>(domain, id, go);

            pet.AddComponent <AnimatorComponent>();
            pet.AddComponent <MoveComponent>();
            pet.AddComponent <TurnComponent>();
            pet.AddComponent <UnitPathComponent>();
            pet.AddComponent <NumericComponent>();

            petComponent.Add(pet);
            return(pet);
        }
예제 #3
0
파일: PetComponent.cs 프로젝트: aoehuge/ET
 public void Awake()
 {
     Instance = this;
 }