12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Events;
- using KairoEngine.Core;
- namespace KairoEngine.CharacterSystem
- {
- /// <summary>
- /// Action to move a character in a certain direction and speed.
- /// </summary>
- public class ZombieIdleAction : IAction
- {
- CharacterController character; // Reference to the character that will perform the action
- int varient;
- bool done = false;
- /// <summary>
- /// Action that will make a character play an zombie idle animation.
- /// </summary>
- /// <param name="character">The CharacterController performing the action.</param>
- /// <param name="varient">Use numbers 1 to 8 for different animations.</param>
- public ZombieIdleAction(CharacterController character, int varient)
- {
- this.character = character;
- this.varient = varient;
- }
- public void Start()
- {
- float v = (float)varient;
- character.animator.SetFloat("ZombieIdleVarient", v);
- character.animator.SetFloat("vertical", 0);
- }
- public void Update() { }
- public void End()
- {
- done = true;
- }
- public bool IsDone()
- {
- return done;
- }
- }
- }
|