Пример #1
0
    private void SpawnBottomBase()
    {
        for (int i = 0; i < worldZSize; i++)
        {
            for (int j = 0; j < baseHeight + 1; j++)
            {
                Vector3Int tilePos = new Vector3Int(j, 0, i);
                Instantiate(groundPrefab, tilePos, Quaternion.identity, terrainHolder);
            }
        }


        for (int i = 0; i < baseWidth; i++)
        {
            for (int j = 0; j < baseHeight + 1; j++)
            {
                if (((i == baseWidth - 1) || (j == baseHeight)) && (i < (((int)baseWidth / 2) - 1) || (i > (((int)baseWidth / 2) + 1))) && tileObjects[j, i] == null)
                {
                    Vector3Int tilePos = new Vector3Int(j, 1, i);
                    tileObjects[j, i] = Instantiate(wallPrefab, tilePos, Quaternion.identity, terrainHolder);
                }
            }
        }

        //Spawn Fish Bucket
        {
            Vector3Int tilePos = new Vector3Int(baseHeight / 2, 1, (baseWidth / 2));
            tileObjects[tilePos.x, tilePos.z]     = Instantiate(fishBucketPrefab, tilePos, Quaternion.identity, terrainHolder);
            tileObjects[tilePos.x, tilePos.z].tag = "BucketA";
            fishBucketA  = tileObjects[tilePos.x, tilePos.z].GetComponent <FishBucket>();
            buff.bucketA = tileObjects[tilePos.x, tilePos.z];
        }
    }
Пример #2
0
    private void Start()
    {
        fishBucket = GameObject.Find("Bucket").GetComponent <FishBucket>();
        uIManager  = GameObject.Find("UIManager").GetComponent <UIManager>();
        sun        = GameObject.Find("Sun").GetComponent <Sun>();

        uIManager.ResetScore();
    }
Пример #3
0
    // Start is called before the first frame update
    void Start()
    {
        unit  = GetComponent <Units>();
        world = FindObjectOfType <WorldHandler>();

        if (tag == "UnitA")
        {
            fishpool = world.fishBucketA;
        }
        else
        {
            fishpool = world.fishBucketB;
        }
    }