public override CellState GetNextState(int neighborhoods) { if (neighborhoods == 3) { return(LivingState.GetInstance()); } else { return(this); } }
//start after start function; void Awake() { if (GameObject.FindGameObjectWithTag("Player") != null) //searching for an object with a player tag { hasTarget = true; player = GameObject.FindGameObjectWithTag("Player").transform; targetEntity = player.GetComponent <LivingState>(); myCollisionRadius = GetComponent <CapsuleCollider>().radius; playerCollisionRadius = player.GetComponent <CapsuleCollider>().radius; } }
public static CellState GetLivingState() => LivingState.GetInstance();