コード例 #1
0
ファイル: HoloDeck.cs プロジェクト: justi1jc/FPS
 /* Listens for the player leaving the active cell. In the event that this
  * happens, the holodeck shifts its focus to the player's current position. */
 public void ManageShifting()
 {
     if (players == null || players.Count == 0)
     {
         return;
     }
     if (players[0] != null && !focalCell.Contains(players[0].transform.position))
     {
         ShiftExterior();
     }
 }
コード例 #2
0
ファイル: HoloDeck.cs プロジェクト: justi1jc/FPS
    /* Returns the cell that contains this pos, or null. */
    public HoloCell ContainingCell(Vector3 pos)
    {
        float DISTANCE = 50;

        for (int i = 0; i < cells.Count; i++)
        {
            HoloCell hc = cells[i];
            if (hc.Contains(pos))
            {
                return(hc);
            }
        }
        return(null);
    }