コード例 #1
0
    public GameObject GenerateIsland()
    {
        GameObject islandObj = Instantiate(islandBasePrefab);
        Island     island    = islandObj.GetComponent <Island>();

        // Add tiles
        GrowTiles(island);

        // Add NPCs
        if (Random.value < npcChance)
        {
            PlaceNpcs(island);
        }

        // Give islands different SortingGroup orders
        islandObj.GetComponent <SortingGroup>().sortingOrder = Random.Range(0, 1000);
        StartCoroutine(island.BeginTimeout(islandLifetime));
        return(islandObj);
    }