void OnEnable() { LinkerData._instance_ = this; self = this; //EditorApplication.playmodeStateChanged = HandleOnPlayModeChanged; }
public static void CheckUsedActions() { if (HutongGames.PlayMakerEditor.Actions.GetUsageCount(typeof(ConditionalExpression)) > 0) { LinkerData.RegisterClassDependancy(typeof(ConditionalExpression), typeof(ConditionalExpression).FullName); } }
/* * void HandleOnPlayModeChanged() * { * // This method is run whenever the playmode state is changed. * if (!EditorApplication.isPlaying) * { * PlayModeFlag = true; * Debug.Log ("HandleOnPlayModeChanged"); * } * } */ public static void IncludeConditionalExpression() { LinkerData.RegisterClassDependancy(typeof(ConditionalExpression), typeof(ConditionalExpression).FullName); }
void OnEnable() { LinkerData._instance_ = this; self = this; }
public void UpdateLinkerContent(LinkerData _target) { _target.LinkContentUpdateDone = false; _target.Asset = PlayMakerEditorUtils.GetAssetByName("link.xml") as TextAsset; string _assetPath = Application.dataPath +"/link.xml"; // create xml doc XmlDocument _doc = new XmlDocument(); XmlNode _rootNode; if (_target.Asset != null) { _assetPath = AssetDatabase.GetAssetPath(_target.Asset); _doc.LoadXml(_target.Asset.text); _rootNode = _doc.SelectSingleNode("linker"); }else{ _rootNode = _doc.CreateNode(XmlNodeType.Element,"linker",null); _doc.AppendChild(_rootNode); } if (_rootNode==null){ Debug.LogError("Link.xml seems to be badly formatted"); return; } foreach(KeyValuePair<string, List<string>> entry in _target.linkerEntries) { string assemblyName = entry.Key; XmlNode _assemblyNode = _doc.SelectSingleNode("//assembly[@fullname='"+assemblyName+"']"); if (_assemblyNode==null) { _assemblyNode = _doc.CreateNode(XmlNodeType.Element,"assembly",null); _rootNode.AppendChild(_assemblyNode); XmlAttribute _fullnameAttr = _doc.CreateAttribute("fullname"); _fullnameAttr.Value = assemblyName; _assemblyNode.Attributes.Append(_fullnameAttr); } foreach(string _type in entry.Value) { XmlNode _typeNode = _assemblyNode.SelectSingleNode("./type[@fullname='"+_type+"']"); if (_typeNode==null) { _typeNode = _doc.CreateNode(XmlNodeType.Element,"type",null); _assemblyNode.AppendChild(_typeNode); XmlAttribute _fullnameAttr = _doc.CreateAttribute("fullname"); _fullnameAttr.Value = _type; _typeNode.Attributes.Append(_fullnameAttr); XmlAttribute _preserveAttr = _doc.CreateAttribute("preserve"); _preserveAttr.Value = "all"; _typeNode.Attributes.Append(_preserveAttr); } } } Debug.Log("Updated and Saving linker xml content to : "+_assetPath); _doc.Save(_assetPath); AssetDatabase.Refresh(); EditorUtility.FocusProjectWindow (); _target.Asset = AssetDatabase.LoadAssetAtPath(_assetPath,typeof(TextAsset)) as TextAsset; _target.LinkContentUpdateDone = true; }