Ejemplo n.º 1
0
 IEnumerator Co_SpawnDots()
 {
     for (int i = 0; i < MyGeoGroupInfo.StartNumber; i++)
     {
         SpawnCreatures(0, NatureController.GetRandomPos(), true);
         yield return(new WaitForEndOfFrame());
     }
 }
Ejemplo n.º 2
0
        public NodeVal Wander()
        {
            if (!isWandering)
            {
                isWandering       = true;
                wanderDestination = NatureController.GetRandomPos(Size);
                wanderTime        = 0f;
            }
            else
            {
                wanderTime += Time.deltaTime;
                if (wanderTime > 2f)
                {
                    isWandering = false;
                }

                if (Vector3.Distance(transform.position, wanderDestination) < 0.2f)
                {
                    isWandering = false;
                }
            }

            return(NodeVal.Success);
        }