예제 #1
0
    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);
    }
예제 #2
0
    public bool Bother(PersonageType personage)
    {
        Action = Action.Bother;
        _characterController.BotherSleep(personage);

        return(true);
    }
예제 #3
0
    Personage CreatePersonage(PersonageType type, int position)
    {
        Personage personage = PersonageFactory.Create(type);

        personage.transform.parent = transform;

        return(personage);
    }
예제 #4
0
    public void Init(PersonageType personage)
    {
        _logic         = Logic.instance;
        _personageType = personage;

        SetAnimations();
        SetListeners();
    }
예제 #5
0
    public void OnBotherSleep(object personageType, System.EventArgs events)
    {
        PersonageType personage = (PersonageType)personageType;

        Bother(personage);
    }
예제 #6
0
 public void BotherSleep(PersonageType personage)
 {
     sTreeps.animation.Blend("Bother" + personage, 3.0f, 0.5f);
 }