コード例 #1
0
        void Awake()
        {
            BoardProcessor board = FindObjectOfType <BoardProcessor>();

            if (transform.parent != board)
            {
                transform.parent = board.transform;
            }
        }
コード例 #2
0
ファイル: ConveyerBelt.cs プロジェクト: bjageman/Robo-Rampage
        public void endTurnTrigger(BotMovement bot)
        {
            BoardProcessor board          = FindObjectOfType <BoardProcessor>();
            TurnManager    turnManager    = FindObjectOfType <TurnManager>();
            Vector3        botPosition    = bot.transform.position;
            Waypoint       moveToWaypoint = board.GetNearestWaypoint(new Vector2Int(
                                                                         Mathf.RoundToInt(botPosition.x + transform.forward.x * moveSpaces),
                                                                         Mathf.RoundToInt(botPosition.z + transform.forward.z * moveSpaces)
                                                                         ));

            if (moveToWaypoint != null)
            {
                bot.AddCommandToQueue(new Command("MOVE", moveToWaypoint));
            }
            turnManager.AddPlayerToQueue(bot);
        }