コード例 #1
0
    void Awake()
    {
        UpgradeInfo.SetActive(false);
        _animator          = GetComponent <Animator>();
        _health            = MaxHealth;
        _gameController    = FindObjectOfType <GameController>();
        _plantationManager = FindObjectOfType <PlantationManager>();
        _currencyManager   = FindObjectOfType <CurrencyManager>();

        _upgradeManager = new PlantationUpgradeManager();

        AssignHealthBar();
        AddSpawnPoints();
        SpawnTeaLeaf();
        AssignUpgrades();
    }
コード例 #2
0
    // Use this for initialization
    IEnumerator Start()
    {
        _shop              = GameObject.Find("Shop");
        _teapotManager     = FindObjectOfType <TeapotManager>();
        _plantationManager = FindObjectOfType <PlantationManager>();


        _coffeeMakerPrefabs = new Dictionary <CoffeeMakerType, GameObject>()
        {
            { CoffeeMakerType.Cafetiere, _cafetiere },
            { CoffeeMakerType.ItalianStove, _italianStove },
        };
        HideShop();

        _randomGenerator = new System.Random();

        _gameController = FindObjectOfType <GameController>();

        _waves         = SpawnWave.Levels;
        _nextWaveIndex = -1;

        yield return(SpawnNextWave());
    }