Browse Source

Fixed CustomGUI class not in Fungus namespace #353

master
chrisgregan 9 years ago
parent
commit
c9a081f4fd
  1. 11
      Assets/Fungus/Flowchart/Editor/CustomGUI.cs
  2. 7
      Assets/Fungus/Flowchart/Editor/EditorExtensions.cs
  3. 15
      Assets/Fungus/Flowchart/Editor/EditorZoomArea.cs
  4. 7
      Assets/Fungus/Flowchart/Editor/GLDraw.cs

11
Assets/Fungus/Flowchart/Editor/CustomGUI.cs

@ -4,11 +4,14 @@ using UnityEditor;
using System; using System;
using System.Reflection; using System.Reflection;
/** namespace Fungus
{
/**
* Utility functions for drawing custom UI in the editor * Utility functions for drawing custom UI in the editor
*/ */
public static class CustomGUI public static class CustomGUI
{ {
public static Texture2D CreateBlackTexture() public static Texture2D CreateBlackTexture()
{ {
Texture2D blackTex = new Texture2D(1,2); Texture2D blackTex = new Texture2D(1,2);
@ -37,4 +40,6 @@ public static class CustomGUI
separatorStyle.margin.bottom = 10; separatorStyle.margin.bottom = 10;
GUILayout.Box(blackTex,separatorStyle); GUILayout.Box(blackTex,separatorStyle);
} }
}
} }

7
Assets/Fungus/Flowchart/Editor/EditorExtensions.cs

@ -3,8 +3,11 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
public static class EditorExtensions namespace Fungus
{ {
public static class EditorExtensions
{
/// <summary> /// <summary>
/// FindDerivedTypesFromAssembly allows a user to query all of types derived from a /// FindDerivedTypesFromAssembly allows a user to query all of types derived from a
/// particular Type at runtime. /// particular Type at runtime.
@ -59,4 +62,6 @@ public static class EditorExtensions
{ {
return FindDerivedTypesFromAssembly(System.Reflection.Assembly.GetAssembly(baseType), baseType, classOnly); return FindDerivedTypesFromAssembly(System.Reflection.Assembly.GetAssembly(baseType), baseType, classOnly);
} }
}
} }

15
Assets/Fungus/Flowchart/Editor/EditorZoomArea.cs

@ -2,9 +2,12 @@
using UnityEngine; using UnityEngine;
// Helper Rect extension methods namespace Fungus
public static class RectExtensions
{ {
// Helper Rect extension methods
public static class RectExtensions
{
public static Vector2 TopLeft(this Rect rect) public static Vector2 TopLeft(this Rect rect)
{ {
return new Vector2(rect.xMin, rect.yMin); return new Vector2(rect.xMin, rect.yMin);
@ -47,10 +50,10 @@ public static class RectExtensions
result.y += pivotPoint.y; result.y += pivotPoint.y;
return result; return result;
} }
} }
public class EditorZoomArea public class EditorZoomArea
{ {
private const float kEditorWindowTabHeight = 21.0f; private const float kEditorWindowTabHeight = 21.0f;
private static Matrix4x4 _prevGuiMatrix; private static Matrix4x4 _prevGuiMatrix;
@ -76,4 +79,6 @@ public class EditorZoomArea
GUI.EndGroup(); GUI.EndGroup();
GUI.BeginGroup(new Rect(0.0f, kEditorWindowTabHeight, Screen.width, Screen.height)); GUI.BeginGroup(new Rect(0.0f, kEditorWindowTabHeight, Screen.width, Screen.height));
} }
}
} }

7
Assets/Fungus/Flowchart/Editor/GLDraw.cs

@ -2,8 +2,11 @@ using UnityEngine;
using System.Collections; using System.Collections;
using System; using System;
public class GLDraw namespace Fungus
{ {
public class GLDraw
{
/* /*
* Clipping code: http://forum.unity3d.com/threads/17066-How-to-draw-a-GUI-2D-quot-line-quot?p=230386#post230386 * Clipping code: http://forum.unity3d.com/threads/17066-How-to-draw-a-GUI-2D-quot-line-quot?p=230386#post230386
* Thick line drawing code: http://unifycommunity.com/wiki/index.php?title=VectorLine * Thick line drawing code: http://unifycommunity.com/wiki/index.php?title=VectorLine
@ -285,4 +288,6 @@ public class GLDraw
float rtt = rt * t; float rtt = rt * t;
return rt * rt * rt * s + 3 * rt * rtt * st + 3 * rtt * t * et + t * t * t * e; return rt * rt * rt * s + 3 * rt * rtt * st + 3 * rtt * t * et + t * t * t * e;
} }
}
} }
Loading…
Cancel
Save