Beispiel #1
0
 public void RestartGame()
 {
     thePlayer.gameObject.SetActive(false);
     ScoreManager.GetInstance().scoreIncreasing = false;
     AgeManager.Getinstance().ageIncreasing     = false;
     theDeathMenu.gameObject.SetActive(true);
     //StartCoroutine("RestartGameCo");
 }
Beispiel #2
0
 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);
        }
    }
Beispiel #4
0
 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;
 }
Beispiel #5
0
    // 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);
    }
Beispiel #6
0
 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>();
 }