Skip to content

Instantly share code, notes, and snippets.

@housei
Last active November 12, 2015 08:13
Show Gist options
  • Save housei/61d0adb3eb801a2e7dd5 to your computer and use it in GitHub Desktop.
Save housei/61d0adb3eb801a2e7dd5 to your computer and use it in GitHub Desktop.
uFrame1.6 custom types
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);
}
}
@housei
Copy link
Author

housei commented Nov 12, 2015

This code is not working properly !
Repeated uFrame graph "Save & Compile" It does not work properly .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment