public void Redo(ILevelEditorUndo undo) { if (LevelEditorWorld.TryGetObject(targetInstanceId, out var target)) { undo.LevelEditor.ObjectManager.DeleteObject(target, false); } }
public override void OnModeLateUpdate() { if (Input.GetButtonDown(selectAction) && CanSelectObject()) { GameObject go = LevelEditorWorld.Raycast(LevelEditor.LevelEditorCamera.CameraComponent.ScreenPointToRay(Input.MousePosition)); Selection.SetSelection(go != null ? go.GetComponent <ILevelEditorObject>() : null); } }
public T[] GetObjects <T>() where T : Object { if (objects == null || objects.Length == 0) { return(Array.Empty <T>()); } return(LevelEditorWorld.TryGetObjects(objects, out T[] value) ? value : Array.Empty <T>()); }
public Object GetObject(Type type) { if (objects == null || objects.Length == 0) { return(null); } return(LevelEditorWorld.TryGetObject(objects[0], type, out Object value) ? value : null); }
public void OnPooled() { LevelEditorWorld.RemoveObject(this); for (int i = 0; i < poolables.Length; i++) { poolables[i].OnLevelEditorPooled(); } }
public bool TryGetObject(out ILevelEditorObject value) { if (objects == null || objects.Length == 0) { value = null; return(false); } return(LevelEditorWorld.TryGetObject(objects[0], out value)); }
public bool TryGetObject <T>(Type type, out T value) where T : Object { if (objects == null || objects.Length == 0) { value = null; return(false); } return(LevelEditorWorld.TryGetObject(objects[0], out value)); }
public void Redo(ILevelEditorUndo undo) { if (LevelEditorWorld.TryGetObject(objects, out ILevelEditorObject target)) { Transform targetTransform = target.MyGameObject.transform; targetTransform.position = toPositions; targetTransform.eulerAngles = toRotations; targetTransform.localScale = toScales; } }
public void Show(Type type, bool sceneObject) { if (sceneObject) { List <UnityObject> allObjects = new List <UnityObject>(LevelEditorWorld.GetObjects(type)); allObjects.Insert(0, null); listView.SetItems(allObjects); } Show(true); }
public void Redo(ILevelEditorUndo undo) { for (int i = 0; i < objects.Length; i++) { if (LevelEditorWorld.TryGetObject(objects[i], out ILevelEditorObject target)) { Transform targetTransform = target.MyGameObject.transform; targetTransform.position = toPositions[i]; targetTransform.eulerAngles = toRotations[i]; targetTransform.localScale = toScales[i]; } } }
public void OnUnPooled() { LevelEditorWorld.AddObject(this); if (originalValues != null) { for (int i = 0; i < originalValues.Length; i++) { exposedComponents[i].ApplyWrapper(originalValues[i], true); } } for (int i = 0; i < poolables.Length; i++) { poolables[i].OnLevelEditorUnpooled(); } }