Beispiel #1
0
    public bool LoadScript(string text, string scriptName, Type type)
    {
        bool result = false;

        if (type == Type.Lua)
        {
            LuaFunctions luaFunctions = new LuaFunctions();

            if (luaFunctions.LoadScript(text, scriptName))
            {
                FunctionsSets.Add(luaFunctions);
            }
        }
        else
        {
            CSharpFunctions netFunctions = new CSharpFunctions();
            if (netFunctions.LoadScript(text, scriptName))
            {
                FunctionsSets.Add(netFunctions);
            }
        }

        return(result);
    }
        private static Dictionary <string, System.Type> FindComponentsInAssembly()
        {
            componentTypes = new Dictionary <string, System.Type>();

            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies().Where(asm => !CSharpFunctions.IsDynamic(asm)))
            {
                foreach (Type type in assembly.GetTypes())
                {
                    BuildableComponentNameAttribute[] attribs = (BuildableComponentNameAttribute[])type.GetCustomAttributes(typeof(BuildableComponentNameAttribute), false);
                    if (attribs != null && attribs.Length > 0)
                    {
                        foreach (BuildableComponentNameAttribute compNameAttr in attribs)
                        {
                            componentTypes.Add(compNameAttr.ComponentName, type);
                            UnityDebugger.Debugger.LogFormat(ComponentLogChannel, "Found component in assembly: {0}", compNameAttr.ComponentName);
                        }
                    }
                }
            }

            return(componentTypes);
        }
Beispiel #3
0
        private static Dictionary <string, System.Type> FindOrderActionsInAssembly()
        {
            var orderActionTypes = new Dictionary <string, System.Type>();

            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies().Where(asm => !CSharpFunctions.IsDynamic(asm)))
            {
                foreach (Type type in assembly.GetTypes())
                {
                    OrderActionNameAttribute[] attribs = (OrderActionNameAttribute[])type.GetCustomAttributes(typeof(OrderActionNameAttribute), false);
                    if (attribs != null && attribs.Length > 0)
                    {
                        foreach (OrderActionNameAttribute compNameAttr in attribs)
                        {
                            orderActionTypes.Add(compNameAttr.OrderActionName, type);
                            UnityDebugger.Debugger.Log(OrderActionsLogChannel, string.Format("Found OrderAction in assembly: {0}", compNameAttr.OrderActionName));
                        }
                    }
                }
            }

            return(orderActionTypes);
        }
 public void Init()
 {
     csharpFunctions = new CSharpFunctions();
     luaFunctions    = new LuaFunctions();
 }
 public void Init()
 {
     Debug.IsLogEnabled = true;
     csharpFunctions    = new CSharpFunctions();
     luaFunctions       = new LuaFunctions();
 }
Beispiel #6
0
 public void Init()
 {
     Debug.IsLogEnabled = false;
     functions          = new CSharpFunctions();
 }
Beispiel #7
0
 public void Init()
 {
     functions = new CSharpFunctions();
 }