public void OnDeletePrefab() { prefabs.RemoveAt(prefabList.CurrentIndex); var currentDLItem = prefabList.GetItems()[prefabList.CurrentIndex]; prefabList.RemoveItem(currentDLItem); prefabList.CurrentIndex = -1; RebuildPrefabList(); }
public void OnDeleteGradientItem() { GlobalState.Settings.skies.RemoveAt(gradientList.CurrentIndex); var currentDLItem = gradientList.GetItems()[gradientList.CurrentIndex]; gradientList.RemoveItem(currentDLItem); gradientList.CurrentIndex = -1; // TODO: select the previous one? the one at the same index? RebuildGradientList(); }
private void OnCameraRemoved(GameObject gObject) { CameraController cameraController = gObject.GetComponent <CameraController>(); if (null == cameraController) { return; } foreach (var item in cameraList.GetItems()) { CameraItem cameraItem = item.Content.GetComponent <CameraItem>(); if (cameraItem.cameraObject == gObject) { cameraList.RemoveItem(item); return; } } }
private void OnGrassRemoved(GameObject gObject) { GrassController grassController = gObject.GetComponent <GrassController>(); if (null == grassController) { return; } foreach (var item in grassList.GetItems()) { GrassItem grassItem = item.Content.GetComponent <GrassItem>(); if (grassItem.grassObject == gObject) { grassList.RemoveItem(item); return; } } }
private void OnLightRemoved(GameObject gObject) { LightController controller = gObject.GetComponent <LightController>(); if (null == controller) { return; } foreach (var item in lightList.GetItems()) { LightItem lightItem = item.Content.GetComponent <LightItem>(); if (lightItem.lightObject == gObject) { lightList.RemoveItem(item); return; } } }