コード例 #1
0
    // Use this for initialization
    void Start()
    {
        var realPlayer = (GameObject)Instantiate(player,GetLocation(playerStart),Quaternion.identity);
        playerGrid = realPlayer.GetComponent<GridObject>();
        gridObjects = new GridObject[25];
        playerGrid.SetLocation(playerStart,GetLocation(playerStart));
        grid = new GridObject[5][];

        for( int i = 0; i < 5; i ++ ) {
            grid[i] = new GridObject[5];
        }
        grid[(int)playerStart.x][(int)playerStart.y] = playerGrid;
    }