Beispiel #1
0
    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;
            }
        }
    }
Beispiel #2
0
 private void Awake()
 {
     instance = this;
 }
Beispiel #3
0
 private void ReleaseLevel(int levelIndex)
 {
     WayCrafter.ClearLevelBuildedBlocks();
     levels[levelIndex].SetActive(false);
 }