public static Personage Create(PersonageType personageType) { System.Type personage; switch (personageType) { case PersonageType.Young: personage = typeof(Young); break; case PersonageType.Cactus: personage = typeof(Cactus); break; case PersonageType.Bonsai: personage = typeof(Bonsai); break; case PersonageType.Animal: personage = typeof(Animal); break; default: personage = typeof(Animal); break; } GameObject personageGO = GameObject.Instantiate(Resources.Load("Prefabs/Personages/" + personage.Name), Vector3.zero, Quaternion.identity) as GameObject; return(personageGO.GetComponent(personage.Name) as Personage); }
public bool Bother(PersonageType personage) { Action = Action.Bother; _characterController.BotherSleep(personage); return(true); }
Personage CreatePersonage(PersonageType type, int position) { Personage personage = PersonageFactory.Create(type); personage.transform.parent = transform; return(personage); }
public void Init(PersonageType personage) { _logic = Logic.instance; _personageType = personage; SetAnimations(); SetListeners(); }
public void OnBotherSleep(object personageType, System.EventArgs events) { PersonageType personage = (PersonageType)personageType; Bother(personage); }
public void BotherSleep(PersonageType personage) { sTreeps.animation.Blend("Bother" + personage, 3.0f, 0.5f); }