unity enum
private enum State
{
Idle,
Walk,
Attack,
}using UnityEngine;
using System.Collections;
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;
else if(dir == Direction.South)
dir = Direction.North;
else if(dir == Direction.East)
dir = Direction.West;
else if(dir == Direction.West)
dir = Direction.East;
return dir;
}
}
Also in C#:
- unity set material
- how to get specific length of row in matrix c#
- redirect to https codeigniter
- c# list string return concatenate
- c# how to take from a float
- asp.net tag helper checkbox
- decalre an int list mvc
- c# how to initialize an array
- c# convert list to string
- c# get every point in a line in matrix
- c# loop datatable rows
- iphone
- singleton unity
- Exception thrown: 'System.FormatException' in mscorlib.dll dates
- c# read file stream
- exit game unity
- abstract class c#
- decimals not stored in azure tables
- c# random string
- Unity if object doens't exist
- getcomponent c#
- asp net mvc 5 return view from another controller
- .net core session
- godot c# move towards