protected virtual void InteractableObjectUsed(object sender, InteractableObjectEventArgs e) { //Debug.Log("InteractableObjectUsed"); PropManager propManagerScriptRef = this.GetComponent <PropManager>(); //Vector3 cursorPosition = getCursor(sender, e).transform.position; // add new instance of prop if (!CurrentPropManager.Instance.getCurrentPropObj().name.Equals("Empty")) { GameObject recentProp = propManagerScriptRef.addProp(currentPropPrefab, cursorTransform.position - currentProp.GetComponent <Prop>().getCenterObjectOffset()); if (CurrentPropManager.Instance.getPropBeingMoved() == true) { UIManager.Instance.openUIScreen(UIManager.UIScreens.EditProp, recentProp); CurrentPropManager.Instance.clearCurrentPropObj(); CurrentPropManager.Instance.setPropBeingMoved(false); } } }
// reverts a moved prop back to its position public GameObject revertMovedProp() { setPropBeingMoved(false); return(oldPropManagerRef.addProp(CurrentPropManager.Instance.getCurrentPropObj(), oldPropPosition)); }