public override void OnGUI(ModuleMaker maker) { WindowDesignUtility.SectionLabel("Surfaces"); EditorGUILayout.BeginHorizontal(); this.template = (ProjectorTemplate)EditorGUILayout.EnumPopup("Template", this.template); TemplateToSelection(); using (new EditorGUI.DisabledScope(this.template != ProjectorTemplate.Custom)) this.selection = (ProjectorSelection)EditorGUILayout.EnumFlagsField(this.selection); EditorGUILayout.EndHorizontal(); EditorGUILayout.Separator(); WindowDesignUtility.SectionLabel("Rendering"); this.target = (CameraTarget)EditorGUILayout.EnumPopup("Camera Target", this.target); EditorGUILayout.Separator(); WindowDesignUtility.SectionLabel("Dimensions"); bool wideMode = EditorGUIUtility.wideMode; EditorGUIUtility.wideMode = true; this.width = EditorGUILayout.FloatField("Width (m)", this.width); this.height = EditorGUILayout.FloatField("Height (m)", this.height); this.length = EditorGUILayout.FloatField("Length (m)", this.length); this.position = EditorGUILayout.Vector3Field("Position", this.position); EditorGUIUtility.wideMode = wideMode; }
public ProjectorModule() { this.template = ProjectorTemplate.Basic; this.selection = (ProjectorSelection)0; this.width = 3f; this.height = 2.45f; this.length = 3f; this.position = SceneCameraRay(); }
private void TemplateToSelection() { switch (this.template) { case ProjectorTemplate.Basic: this.selection = ProjectorSelection.Front | ProjectorSelection.Bottom | ProjectorSelection.Left | ProjectorSelection.Right; break; case ProjectorTemplate.Cube: this.selection = (ProjectorSelection) ~0; break; } }
private int SelectionToDisplayId(ProjectorSelection selection) { int i = 0; if (this.selection.HasFlag(ProjectorSelection.Left)) { if (selection == ProjectorSelection.Left) { return(i); } ++i; } if (this.selection.HasFlag(ProjectorSelection.Front)) { if (selection == ProjectorSelection.Front) { return(i); } ++i; } if (this.selection.HasFlag(ProjectorSelection.Right)) { if (selection == ProjectorSelection.Right) { return(i); } ++i; } if (this.selection.HasFlag(ProjectorSelection.Back)) { if (selection == ProjectorSelection.Back) { return(i); } ++i; } if (this.selection.HasFlag(ProjectorSelection.Bottom)) { if (selection == ProjectorSelection.Bottom) { return(i); } ++i; } if (this.selection.HasFlag(ProjectorSelection.Top)) { if (selection == ProjectorSelection.Top) { return(i); } ++i; } return(i); }