public virtual void OnMouseOver() { if (haveBuilded && inConstruction == null) { haveBuilded = false; isPreviewing = false; } if (!isPreviewing && inConstruction == null && !haveBuilded) { inConstruction = WayCrafter.ShowPreview(transform.position); isPreviewing = true; } if (isPreviewing && !haveBuilded && Input.GetMouseButtonDown(0)) { AnimationManager.instance.PlayDecreaseBlockAnimation(); if (InventoryManager.instance.HaveBlock()) { print("Construindo novo bloco!"); Destroy(inConstruction); inConstruction = WayCrafter.BuildBlock(transform.position); haveBuilded = true; } } }
private void Awake() { instance = this; }
private void ReleaseLevel(int levelIndex) { WayCrafter.ClearLevelBuildedBlocks(); levels[levelIndex].SetActive(false); }