private void RotateGizmoSpawned(EditorGizmos.GizmoRotate data)
 {
     GizmoEvents.rotateGizmoActive = true;
     GizmoEvents.offsetGizmoActive = false;
     GizmoEvents.gizmosRotate      = HighLogic.FindObjectsOfType <EditorGizmos.GizmoRotate> ();
     GizmoEvents.gizmoRotateHandle = HighLogic.FindObjectOfType <EditorGizmos.GizmoRotateHandle> ();
     Log.dbg("Rotate gizmo was spawned 2");
 }
            private void Start()
            // I use Start instead of Awake because whatever setup the editor does to the gizmo won't be done yet
            {
                EditorGizmos.GizmoRotate rotate = null;
                EditorGizmos.GizmoOffset offset = null;

                if (gameObject.GetComponentCached(ref rotate) != null)
                {
                    onRotateGizmoSpawned.Fire(rotate);
                }
                else if (gameObject.GetComponentCached(ref offset) != null)
                {
                    onOffsetGizmoSpawned.Fire(offset);
                }
                else
                {
                    Log.warn("Didn't find a gizmo on this GameObject -- something has broken");
                }

                // could destroy this MB now, unless you wanted to use OnDestroy to sent an event
            }
 private void RotateGizmoSpawned(EditorGizmos.GizmoRotate data)
 {
     Log.trace("Rotate gizmo was spawned 1");
 }
示例#4
0
 private void RotateGizmoSpawned(EditorGizmos.GizmoRotate data)
 {
     Log.Info("Rotate gizmo was spawned");
 }