コード例 #1
0
ファイル: GameManager.cs プロジェクト: mbpmm/Algebra
 public override void Awake()
 {
     base.Awake();
     gameOver    = false;
     points      = player.GetComponent <Points>();
     steps       = player.GetComponent <Steps>();
     walls       = wallMgr.GetComponent <WallsRemaining>();
     sceneSwitch = GetComponent <UIGoToScene>();
 }
コード例 #2
0
            public int GetLevelChunkIndex()
            {
                if (WallsRemaining.Count == 0)
                {
                    return(11);
                }
                if (WallsRemaining.Count == 1)
                {
                    switch (WallsRemaining[0])
                    {
                    case WallDirection.NORTH:
                        return(1);

                    case WallDirection.EAST:
                        return(2);

                    case WallDirection.SOUTH:
                        return(3);

                    case WallDirection.WEST:
                        return(4);

                    default:
                        throw new KeyNotFoundException("Illegal wall direction: " + WallsRemaining[0]);
                    }
                }
                if (WallsRemaining.Count == 2)
                {
                    if (WallsRemaining.Contains(WallDirection.NORTH) && WallsRemaining.Contains(WallDirection.EAST))
                    {
                        return(5);
                    }
                    if (WallsRemaining.Contains(WallDirection.NORTH) && WallsRemaining.Contains(WallDirection.SOUTH))
                    {
                        return(6);
                    }
                    if (WallsRemaining.Contains(WallDirection.NORTH) && WallsRemaining.Contains(WallDirection.WEST))
                    {
                        return(7);
                    }
                    if (WallsRemaining.Contains(WallDirection.EAST) && WallsRemaining.Contains(WallDirection.SOUTH))
                    {
                        return(8);
                    }
                    if (WallsRemaining.Contains(WallDirection.EAST) && WallsRemaining.Contains(WallDirection.WEST))
                    {
                        return(9);
                    }
                    if (WallsRemaining.Contains(WallDirection.SOUTH) && WallsRemaining.Contains(WallDirection.WEST))
                    {
                        return(10);
                    }
                }
                throw new KeyNotFoundException("I can't decide which wall index I am: " + WallsRemaining.Count);
            }
コード例 #3
0
 // Start is called before the first frame update
 void Start()
 {
     walls = wallManager.GetComponent <WallsRemaining>();
     walls.addWall();
 }
コード例 #4
0
ファイル: CollisionCheck.cs プロジェクト: mbpmm/Algebra
 private void Start()
 {
     materialCubo = GetComponent <MeshRenderer>();
     playerPoints = GetComponentInParent <Points>();
     walls        = wallManager.GetComponent <WallsRemaining>();
 }
コード例 #5
0
ファイル: UIWallsRemaining.cs プロジェクト: mbpmm/Algebra
 private void Start()
 {
     walls = wallManager.GetComponent <WallsRemaining>();
 }