//************************************************************ void Start() { GameObject canvas = GameObject.Find("Canvas"); buildingEditMenu = canvas.transform.Find("BuildingEdit").gameObject; highwayEditMenu = canvas.transform.Find("HighwayEdit").gameObject; barrierEditMenu = canvas.transform.Find("BarrierEdit").gameObject; ObjectEditMenu = canvas.transform.Find("3DObjectEdit").gameObject; CameraVanEditMenu = canvas.transform.Find("CameraVanEdit").gameObject; buildingEdit = buildingEditMenu.GetComponent <BuildingEdit>(); highwayEdit = highwayEditMenu.GetComponent <HighwayEdit>(); barrierEdit = barrierEditMenu.GetComponent <BarrierEdit>(); objectEdit = ObjectEditMenu.GetComponent <ObjectEdit>(); cameraVanEdit = CameraVanEditMenu.GetComponent <CameraVanEdit>(); translateX = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_TransX").GetComponent <InputField>(); translateY = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_TransY").GetComponent <InputField>(); translateZ = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_TransZ").GetComponent <InputField>(); rotateX = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_RotateX").GetComponent <InputField>(); rotateY = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_RotateY").GetComponent <InputField>(); rotateZ = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_RotateZ").GetComponent <InputField>(); scaleX = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_ScaleX").GetComponent <InputField>(); scaleY = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_ScaleY").GetComponent <InputField>(); scaleZ = ObjectEditMenu.transform.Find("Panel").Find("TransformPart").Find("InputField_ScaleZ").GetComponent <InputField>(); currentSelectionID = ""; previousSelectionID = ""; }
private void OnTriggerStay2D(Collider2D collision) { try { ObjectEdit objEdit = collision.GetComponent <Collider2D>().gameObject.GetComponent <ObjectEdit>(); if (objEdit) { if (!objEdit.IsActing()) { if (collision.gameObject.transform.parent.CompareTag("Portal")) { Destroy(objEdit.transform.parent.gameObject); } else { Destroy(objEdit.gameObject); } } } } catch (MissingComponentException) { return; } }
public void ChangeSelected(ObjectEdit caller) { ClearSelected(); caller.selected = true; selected = caller; SetLayerUI(); }
public void RemoveObject(ObjectEdit obj) { objects.Remove(obj); if (obj == selected) { ClearSelected(); } }
public void ClearSelected() { foreach (ObjectEdit obj in objects) { obj.selected = false; } selected = null; SetLayerUI(); }
private void UpdateWidget(ObjectEdit edit) { try { Control widget = Host.CreateWidget <Control>(edit.ObjectFX) ?? new MessageWidget(string.Format(Resources.Msg_WidgetNotFound, edit.ObjectFX.WidgetID)); SetWidgetControl(widget); } catch (Exception e) { SetWidgetControl(new MessageWidget(e)); } }
public void ActivateEdit(ObjectEdit edit) { if (edit == null) { if (ActiveEdit != null) { ActiveEdit.OnStatusChanged(FileStatus.Closed); } ActiveEdit = null; return; } if (ActiveEdit != null) { ActiveEdit.StatusChanged -= Edit_FileStatusChanged; } ActiveEdit = edit; ActiveEdit.StatusChanged += Edit_FileStatusChanged; ActiveEdit.OnStatusChanged(edit.IsSaved ? FileStatus.Opened : FileStatus.Changed); }
void Awake() { #if UNITY_IOS foreach (GameObject obj in mobileGameObjects) { obj.SetActive(true); } #elif UNITY_WEBGL if (ObjectEdit.IsMobile()) { foreach (GameObject obj in mobileGameObjects) { obj.SetActive(true); } } #else foreach (GameObject obj in mobileGameObjects) { obj.SetActive(false); } #endif }
public void AddObject(ObjectEdit obj) { objects.Add(obj); }
private void AddEditScript(GameObject obj) { ObjectEdit editScript = obj.AddComponent <ObjectEdit>(); controller.AddObject(editScript); }