void NegativeBuildUI(IPlaceable placeable, PlacementError pe) { cubeMat.SetColor("_RimColor", Color.red); cubeMat.SetFloat("_RimPower", 0.1f); Debug.Log(pe); }
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); }