public void Load() { _layers = ChainLoader.LoadChain("prefab_single", LayerDirectory); PythonScriptHost.Instance.LoadAssembly(typeof(PrefabSingleLogic).Assembly); _interpreter = LoadSingleLayer(_singleLayerName); UpdateLogic(); }
private static PythonSingleLayer LoadSingleLayer(string pythonfile) { string name = System.IO.Path.GetFileName(pythonfile); string fullpath = System.IO.Path.GetFullPath(System.IO.Path.GetDirectoryName(pythonfile)); PythonScriptHost.Instance.AddPath(fullpath); PythonSingleLayer layer = new PythonSingleLayer(PythonScriptHost.Instance, File.ReadAllText(pythonfile), name); return(layer); }
public void UpdateLogic() { AnnotationUpdateUtility.UpdateInvalidatedLayers(_layers); Storage = RuntimeStorage.FromCouchDb("prefab_single_layer"); var args = new ProcessAnnotationArgs(Storage, GetPtypes()); if (File.Exists(_singleLayerName)) { _interpreter = LoadSingleLayer(_singleLayerName); _interpreter.ProcessAnnotations(args); } }
private static PythonSingleLayer LoadSingleLayer(string pythonfile) { string name = System.IO.Path.GetFileName(pythonfile); string fullpath = System.IO.Path.GetFullPath(System.IO.Path.GetDirectoryName(pythonfile)); PythonScriptHost.Instance.AddPath(fullpath); PythonSingleLayer layer = new PythonSingleLayer(PythonScriptHost.Instance, File.ReadAllText(pythonfile), name); return layer; }