コード例 #1
0
 public override CellState GetNextState(int neighborhoods)
 {
     if (neighborhoods == 3)
     {
         return(LivingState.GetInstance());
     }
     else
     {
         return(this);
     }
 }
コード例 #2
0
 //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;
     }
 }
コード例 #3
0
 public static CellState GetLivingState() => LivingState.GetInstance();