private void OnCameraAdded(GameObject gObject) { CameraController cameraController = gObject.GetComponent <CameraController>(); if (null == cameraController) { return; } GameObject cameraItemObject = Instantiate(cameraItemPrefab); CameraItem cameraItem = cameraItemObject.GetComponentInChildren <CameraItem>(); cameraItem.SetCameraObject(gObject); UIDynamicListItem item = cameraList.AddItem(cameraItem.transform); item.UseColliderForUI = true; }
private void OnCameraRenamed(GameObject gObject) { CameraController cameraController = gObject.GetComponent <CameraController>(); if (null == cameraController) { return; } foreach (UIDynamicListItem item in cameraList.GetItems()) { CameraItem cameraItem = item.Content.gameObject.GetComponent <CameraItem>(); if (cameraItem.cameraObject == gObject) { cameraItem.SetItemName(gObject.name); } } }
public void OnSelectCameraItem(object sender, IndexedGameObjectArgs args) { GameObject item = args.gobject; CameraItem cameraItem = item.GetComponent <CameraItem>(); // Select camera in scene CommandGroup command = new CommandGroup("Select Camera"); try { ClearSelection(); AddToSelection(cameraItem.cameraObject); } finally { command.Submit(); } }
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; } } }