Esempio n. 1
0
    public bool OnPointedAt(IPlaceable placeable, BuildTool bt)
    {
        if (currentlyPointingAt == null)
        {
            currentlyPointingAt = bt;

            //Place
            if (placeable != null)
            {
                PlacementError pe = CanPlace(placeable);

                if (pe == PlacementError.None)
                {
                    PositiveBuildUI(placeable);
                    return(true);
                }
                else
                {
                    NegativeBuildUI(placeable, pe);
                    return(false);
                    //display some ui based on error
                }
            }
            else
            {
                //Remove UI

                RemoveError re = CanRemove();

                Debug.Log(re);

                if (re == RemoveError.None)
                {
                    PositiveRemoveUI();
                    return(true);
                }
                else
                {
                    NegativeRemoveUI(re);
                    return(false);
                }
            }
        }

        return(false);
    }
Esempio n. 2
0
 void NegativeRemoveUI(RemoveError re)
 {
     cubeMat.SetColor("_RimColor", Color.red);
     cubeMat.SetFloat("_RimPower", 0.1f);
 }