Example #1
0
    void SaveAndClose()
    {
        File.WriteAllText(filePath, Code);

        if (initiMode)
        {
            // Pass file to the CSharp Compiler
            loader.LoadAndWatchScriptsBundle(new[] { filePath });

            initiMode = false;
        }

        SceneHandler.Instance.Active = false;
    }
Example #2
0
    void SaveAndClose()
    {
        isThereErrors = false;

        foreach (ScriptAsset script in scriptAssets)
        {
            script.UpdateFile();
        }

        if (initMode)
        {
            foreach (ScriptAsset script in scriptAssets)
            {
                loader.LoadAndWatchScriptsBundle(new[] { script.GetFullPath() });
            }

            initMode = false;
        }

        SceneHandler.Instance.Active = false;
    }
Example #3
0
    public static string MakeFlags()
    {
        string[] fileNames = Directory.GetFiles(path + "/flag", "*.cs", SearchOption.AllDirectories);
        CSharpCompiler.ScriptBundleLoader.IScriptBundle bd = csharpLoader.LoadAndWatchScriptsBundle(fileNames);

        Type[] types = bd.assembly.GetTypes();

        Type[] FlagTypes = types.Where(x => x.BaseType.Name == "DefCountryFlag").ToArray();

        var fields = new List <Tuple <string, Type, Type, List <object>, CodeAttributeDeclaration> >();

        foreach (var type in FlagTypes)
        {
            fields.Add(new Tuple <string, Type, Type, List <object>, CodeAttributeDeclaration>(type.Name, type, type, null, null));
        }

        CodeDomGen sourceCodeCreater = new CodeDomGen("CountryFlags", fields);
        string     source            = sourceCodeCreater.Create();

        Debug.Log(source);

        Debug.Log("Load country flag count:" + FlagTypes.Count());
        return(source);
    }