public void RestartGame() { thePlayer.gameObject.SetActive(false); ScoreManager.GetInstance().scoreIncreasing = false; AgeManager.Getinstance().ageIncreasing = false; theDeathMenu.gameObject.SetActive(true); //StartCoroutine("RestartGameCo"); }
private void Start() { spriteManager = ClassManager.instance.spriteManager; inputManager = ClassManager.instance.inputManager; ageManager = ClassManager.instance.ageManager; prefabManager = ClassManager.instance.prefabManager; sfxPlayer = ClassManager.instance.sfxPlayer; restock(); }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player") { RandomAge = Random.Range(-5, 5); AgeManager.Getinstance().AddAge(RandomAge); gameObject.SetActive(false); } }
private void Start() { playerInventory = ClassManager.instance.playerInventory; groundTileManager = ClassManager.instance.groundTileManager; selectedTileController = ClassManager.instance.selectedTileController; sfxPlayer = ClassManager.instance.sfxPlayer; plantManager = ClassManager.instance.plantManager; ageManager = ClassManager.instance.ageManager; foodManager = ClassManager.instance.foodManager; shopManager = ClassManager.instance.shopManager; }
// Use this for initialization public static AgeManager Getinstance() { if (instance == null) { instance = FindObjectOfType <AgeManager>(); if (instance == null) { GameObject container = new GameObject("AgeManager"); instance = container.AddComponent <AgeManager>(); } } return(instance); }
private void setClasses() { inputManager = gameObject.GetComponent <InputManager>(); ageManager = gameObject.GetComponent <AgeManager>(); farmerMovement = farmerObject.GetComponent <FarmerMovement>(); playerInventory = farmerObject.GetComponent <PlayerInventory>(); spriteManager = gameObject.GetComponent <SpriteManager>(); prefabManager = gameObject.GetComponent <PrefabManager>(); dropItem = farmerObject.GetComponent <DropItem>(); selectedTileController = farmerObject.GetComponent <SelectedTileController>(); useItem = farmerObject.GetComponent <UseItem>(); groundTileManager = gameObject.GetComponent <GroundTileManager>(); plantManager = gameObject.GetComponent <PlantManager>(); foodManager = gameObject.GetComponent <FoodManager>(); shopManager = gameObject.GetComponent <ShopManager>(); farmerAnimator = farmerObject.GetComponent <Animator>(); sfxPlayer = soundObject.GetComponent <SfxPlayer>(); }