public void StartPlacing() { TapToPlaceParent tapToPlace = gameObject.GetComponentInChildren <TapToPlaceParent>(); if (tapToPlace == null) { Debug.LogErrorFormat("current gameobject '{0}' does not support the enabling/disabling of the placing box", gameObject.name); return; } //ensure placing is allowed tapToPlace.AllowPlacing(); tapToPlace.TogglePlacing(); }
public void EnablePlacingBox(bool enable) { TapToPlaceParent tapToPlace = gameObject.GetComponentInChildren <TapToPlaceParent>(); if (tapToPlace == null) { Debug.LogErrorFormat("current gameobject '{0}' does not support the enabling/disabling of the placing box", gameObject.name); return; } if (enable) { tapToPlace.AllowPlacing(); } else { tapToPlace.DisallowPlacing(); } }