Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        rb = GetComponent <Rigidbody2D>();

        anim = null;

        state = new IdleState.Idle(this);
        state.Start(this);
    }
Example #2
0
    // Animation

    public void SetAnimation(EntityAnimation newAnim)
    {
        if (anim != null)
        {
            anim.Finish();
        }

        anim = newAnim;

        if (anim != null)
        {
            anim.Begin(this);
        }
    }
 public override void PlayAnimation(EntityAnimation animation)
 {
     switch (animation)
     {
         case EntityAnimation.Cast01:
             Animator.SetTrigger(cast01);
             break;
         case EntityAnimation.Cast02:
             Animator.SetTrigger(cast02);
             break;
         case EntityAnimation.Melee01:
             Animator.SetTrigger(melee01);
             break;
     }
 }
Example #4
0
    protected virtual void Start()
    {
        infoModule = GetComponent <EntityInfo>();

        animationModule = new EntityAnimation(this);
        inventoryModule = new EntityInventory(this);
        movementModule  = new EntityMovement(this);
        visualModule    = new EntityVisual(this);

        characterController = GetComponent <CharacterController>();

        Game.OnCreatedEntity(this);

        if (postStartAction != null)
        {
            postStartAction();
        }
    }
 public abstract void PlayAnimation(EntityAnimation animation);
Example #6
0
 public EntityAnimationClientbound(VarInt id, EntityAnimation anime)
 {
     _id    = id;
     _anime = anime;
 }