private void Start() { soundManager = SoundManager.instance; inventory.transform.SetParent(disableCanvas.transform, false); shop.transform.SetParent(disableCanvas.transform, false); placeButton.interactable = false; plantPlacer = PlantPlacer.instance; infoManager = InfoManager.instance; nature = Nature.instance; plantsGrid = GridMap.instance; shopManager = FindObjectOfType <ShopManager>(); inventoryManager = InventoryManager.instance; timeController = FindObjectOfType <TimeController>(); gameObjects = inventoryManager.GetItemsPrefabs(); string path = Application.persistentDataPath + SceneManagement.index + ".bin"; Debug.Log(Application.persistentDataPath); if (File.Exists(path)) { LoadGame(SceneManagement.index); } else { ShopManager.instance.moneyAmount = 20; Debug.Log(shopManager); for (int i = 0; i <= 3; i++) { ShopManager.instance.AddItemInShop(i); } } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
void Start() { plantPlacer = PlantPlacer.instance; selectedItem = null; }