Last active
November 12, 2015 08:13
-
-
Save housei/61d0adb3eb801a2e7dd5 to your computer and use it in GitHub Desktop.
uFrame1.6 custom types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Invert.Core; | |
using Invert.Core.GraphDesigner; | |
using Invert.IOC; | |
// This code is not working properly ! | |
// Repeated uFrame graph "Save & Compile" It does not work properly . | |
public class TypeRegisterPlugin : DiagramPlugin | |
{ | |
public override decimal LoadPriority | |
{ | |
get { return -1; } | |
} | |
public override bool Enabled | |
{ | |
get { return true; } | |
set { } | |
} | |
public override void Initialize(UFrameContainer container) | |
{ | |
// add type | |
// e.g:RegistType<MyClass>(); | |
} | |
private void RegistType<T>(string group = "", bool isPrimitive = false, bool isUnityEngine = false) | |
{ | |
RegistType(typeof(T), group, isPrimitive, isUnityEngine); | |
} | |
private void RegistType(Type type, string group = "", bool isPrimitive = false, bool isUnityEngine = false) | |
{ | |
var graphTypeInfo = new GraphTypeInfo(); | |
graphTypeInfo.Group = group; | |
graphTypeInfo.IsPrimitive = isPrimitive; | |
graphTypeInfo.IsUnityEngine = isUnityEngine; | |
graphTypeInfo.Label = type.FullName; | |
graphTypeInfo.Name = type.FullName; | |
//graphTypeInfo.Type = type; | |
InvertGraphEditor.TypesContainer.RegisterInstance( | |
graphTypeInfo.GetType(), | |
graphTypeInfo, | |
graphTypeInfo.Name, | |
false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is not working properly !
Repeated uFrame graph "Save & Compile" It does not work properly .