Ok so I’m new to c# and I found a script/project that uses Enumerations to achieve something similar to what I want as a final product of my game.
I have been trying to figure out Enumerations, and I was watching this video but don’t understand how or if I can Add an Animation trigger to something like
South = animator.SetTrigger(“blah blah”);
I would Assume I would have to Define this in a void Update, further down in the script. Is that right?
https://unity3d.com/learn/tutorials/modules/beginner/scripting/enumerations
Here is my guess, but I haven’t tested this yet though.
public class EnumScript : MonoBehaviour
{
enum Direction{North, East, South, West};
void Start ()
{
Direction myDirection;
myDirection = Direction.North;
}
Direction ReverseDirection (Direction dir)
{
if(dir == Direction.North)
dir = Direction.South;
// Does SetTrigger go here??
// animator.SetTrigger("RotateCompassLeft");
//
else if(dir == Direction.South)
dir = Direction.North;
// Or Here, etc?
else if(dir == Direction.East)
dir = Direction.West;
// and here...
else if(dir == Direction.West)
dir = Direction.East;
// etc....
return dir;
}
}