Exemple #1
0
        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;
        }
Exemple #2
0
        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);
                }
            }
        }
Exemple #3
0
        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();
            }
        }
Exemple #4
0
        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;
                }
            }
        }