예제 #1
0
        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();
        }
예제 #2
0
        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();
            }
        }