Tanoda
pb_CameraEditor.cs
Go to the documentation of this file.
1using UnityEngine;
2using System.Collections;
3using System.Reflection;
5
6namespace GILES.Interface
7{
9 {
10 private Camera _camera;
11
12 protected override void InitializeGUI()
13 {
14 _camera = (Camera) target;
15
16 pb_GUIUtility.AddVerticalLayoutGroup(gameObject);
17
18 pb_TypeInspector enabled_inspector = pb_InspectorResolver.GetInspector(typeof(bool));
19
20 enabled_inspector.Initialize("Enabled", UpdateEnabled, OnSetEnabled);
21 enabled_inspector.onValueBeginChange = () => { Undo.RegisterState( new UndoReflection(_camera, "enabled"), "Camera Enabled" ); };
22 enabled_inspector.transform.SetParent(transform);
23 }
24
25 object UpdateEnabled()
26 {
27 return _camera.enabled;
28 }
29
30 void OnSetEnabled(object value)
31 {
32 _camera.enabled = (bool) value;
33 pb_ComponentDiff.AddDiff(target, "enabled", _camera.enabled);
34 }
35 }
36}
Component target
The UnityEngine.Component being edited.
static void AddDiff(Component component, string name, object value)
static void RegisterState(IUndo target, string message)
Definition: Undo.cs:214