public GameObject CreateFace(Enemy.EEnemyType type) { GameObject face = null; switch (type) { case Enemy.EEnemyType.GIRL: face = _girlFace.Allocate(); break; case Enemy.EEnemyType.GRANNY: face = _grannyFace.Allocate(); break; case Enemy.EEnemyType.TRADER: face = _traderFace.Allocate(); break; case Enemy.EEnemyType.CONDUCTOR: face = _conductorFace.Allocate(); break; } return(face); }
protected void _UseSkillFactory(Vector3 target, DOGOMemFactory factory) { if (!factory.isInit) { factory.Initialize(); } var skill = factory.Allocate().GetComponent <HarvestPlayerSkill>(); skill.factory = factory; skill.Activate(target); }
public bool SetRating(RatingInfo _info) { if (ratingsNumber >= _maxNumber) { return(false); } var item = _itemFactory.Allocate().GetComponent <RatingsListItem>(); _LocateItem(item); item.score = _info.score; item.pname = _info.name; item.place = _info.place; return(true); }
public ItemView CreateItemView(Item.EItemType type) { ItemView itemView = null; switch(type) { case Item.EItemType.FLOWER: itemView = _flowerFactory.Allocate().GetComponent<ItemView>(); break; case Item.EItemType.COIN: itemView = _coinFactory.Allocate().GetComponent<ItemView>(); break; case Item.EItemType.QUEST_ITEM: itemView = _questItemFactory.Allocate().GetComponent<ItemView>(); break; } return itemView; }
public virtual FieldUnit Spawn(Field.Tile position, bool new_inst = true) { if (position == null) { return(null); } if (position.unit == null && position.passable) { //TODO //Instantiation FieldUnit fu = this; if (new_inst) { if (_factory != null) { fu = _factory.Allocate().GetComponent <FieldUnit>(); fu.Show(); } else { fu = Instantiate(this); } _allUnits.Add(fu); } fu.direction = Field.Directions.LEFT; position.unit = fu; fu.tile = position; fu._SetPosition(position.tileView.transform.position); fu.Initialize(); GlobalEventSystem.RaiseUnitSpawned(this); return(fu); } return(null); }