コード例 #1
0
    CE_Door GetNextDoor()
    {
        if (!nextRoomInvestigate)
        {
            return(null);
        }
        CE_Door _door    = nextRoomInvestigate.GetNearestDoor(this);
        CE_Door _outDoor = null;

        if (IsInRoom)
        {
            _outDoor           = lastRoom.GetNearestDoor(this);
            transform.position = _outDoor.Position;
            isInRoom           = false;
        }
        lastRoom = nextRoomInvestigate;
        return(_door);
    }
コード例 #2
0
    IEnumerator AIFSM()
    {
        currentAIPhase = AIPhase.Idle;
        if (!nextRoomInvestigate)
        {
            nextRoomInvestigate = GetNextRoom();
        }
        if ((!nextDoorTarget))
        {
            nextDoorTarget = GetNextDoor();
        }
        //Debug.Log($"it's my turn {characterRef.ColorName} with {nextRoomInvestigate.RoomName}");
        yield return(StartCoroutine(IAMove()));

        yield return(StartCoroutine(IAEndMove()));

        yield return(StartCoroutine(IASuggest()));

        OnEndTurn?.Invoke();
    }
コード例 #3
0
 IEnumerator IAEndMove()
 {
     while (endMoveThinking)
     {
         currentAIPhase = AIPhase.RoomEnterThink;
         if (stepCount < diceCount && CurrentCell == nextDoorTarget.Cell)
         {
             endMoveThinking = false;
             EnterInRoom();
         }
         else
         {
             endMoveThinking = false;
         }
         yield return(null);
     }
     nextDoorTarget = null;
     IsMoving       = false;
     stepCount      = 0;
     diceCount      = 0;
     iaNavigation.Reset();
 }
コード例 #4
0
 public void AddDoorLink(CE_Door _door) => roomDoors.Add(_door);