コード例 #1
0
    /// <summary>
    /// mount or unmount a dedicated symbol for legacy vuforia support
    /// </summary>
    static void CheckAndUpdateVersionIfNeeded()
    {
        VersionInfo _version        = new VersionInfo(VuforiaUnity.GetVuforiaLibraryVersion());
        VersionInfo _7_2_20_Version = new VersionInfo("7.2.20");

                #if PLAYMAKER_VUFORIA_7_2_20_OR_NEWER
        if (_version < _7_2_20_Version)
        {
            PlayMakerEditorUtils.UnMountScriptingDefineSymbolToAllTargets(PLAYMAKER_VUFORIA_7_2_20_OR_NEWER);
        }
                #else
        if (_version >= _7_2_20_Version)
        {
            PlayMakerEditorUtils.MountScriptingDefineSymbolToAllTargets(PLAYMAKER_VUFORIA_7_2_20_OR_NEWER);
        }
                #endif

                #if PLAYMAKER_VUFORIA_PRIOR_7_2
        if (_version >= _7_2_20_Version)
        {
            PlayMakerEditorUtils.UnMountScriptingDefineSymbolToAllTargets(PLAYMAKER_VUFORIA_PRIOR_7_2);
        }
                #else
        if (_version < _7_2_20_Version)
        {
            PlayMakerEditorUtils.MountScriptingDefineSymbolToAllTargets(PLAYMAKER_VUFORIA_PRIOR_7_2);
        }
                #endif
    }
コード例 #2
0
    public static void CreateAsset()
    {
        if (LinkerData.instance != null)
        {
            string path = AssetDatabase.GetAssetPath(LinkerData.instance);
            if (string.IsNullOrEmpty(path))
            {
                LinkerData.instance = null;
            }
            else
            {
                Selection.activeObject = LinkerData.instance;
                EditorGUIUtility.PingObject(Selection.activeObject);
                Debug.Log("Linker Wizard already exists at " + path);
                return;
            }
        }

        // search in the assets:
        UnityEngine.Object[] _assets = PlayMakerEditorUtils.GetAssetsOfType(typeof(LinkerData), ".asset");

        if (_assets != null && _assets.Length > 0)
        {
            LinkerData.instance = _assets[0] as LinkerData;

            Selection.activeObject = LinkerData.instance;
            EditorGUIUtility.PingObject(Selection.activeObject);
            Debug.Log("Linker Wizard already exists at " + AssetDatabase.GetAssetPath(LinkerData.instance));
            return;
        }

        PlayMakerEditorUtils.CreateAsset <LinkerData>("Linker Wizard");
    }
コード例 #3
0
ファイル: DataMakerEditorUtils.cs プロジェクト: kimch2/Unity
 static DataMakerEditorUtils()
 {
             #if !DATAMAKER
     Debug.Log("Setting Up ArrayMaker Scripting define symbol 'DATAMAKER'");
     PlayMakerEditorUtils.MountScriptingDefineSymbolToAllTargets("DATAMAKER");
             #endif
 }
コード例 #4
0
    static PlayMakerUtilsDefines()
    {
                #if !PLAYMAKER_UTILS
        PlayMakerEditorUtils.MountScriptingDefineSymbolToAllTargets("PLAYMAKER_UTILS");
                #endif

                #if !PLAYMAKER_UTILS_1_4_OR_NEWER
        PlayMakerEditorUtils.UnMountScriptingDefineSymbolToAllTargets("PLAYMAKER_UTILS_1_4_OR_NEWER");
                #endif

                #if !PLAYMAKER_UTILS_1_5_OR_NEWER
        PlayMakerEditorUtils.UnMountScriptingDefineSymbolToAllTargets("PLAYMAKER_UTILS_1_5_OR_NEWER");
                #endif
    }
コード例 #5
0
    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;
    }
コード例 #6
0
    void OnGUI()
    {
        wantsMouseMove = true;


        if (Event.current.type == EventType.MouseMove)
        {
            Repaint();
        }

        GUILayout.BeginHorizontal(EditorStyles.toolbar);
        GUILayout.FlexibleSpace();
        LiveUpdate = GUILayout.Toggle(LiveUpdate, "Live Update", EditorStyles.toolbarButton);

        GUILayout.EndHorizontal();

        scroll = GUILayout.BeginScrollView(scroll);

        OnGUI_Title("XmlNode References");

        if (DataMakerXmlUtils.xmlNodeLUT != null)
        {
            GUILayout.BeginVertical();
            foreach (KeyValuePair <string, XmlNode> entry in DataMakerXmlUtils.xmlNodeLUT)
            {
                GUILayout.BeginHorizontal();

                if (GUILayout.Button(entry.Key))
                {
                    ToggleXmlNodePreview(entry.Key);
                }

                if (GUILayout.Button("Copy", GUILayout.Width(50)))
                {
                    PlayMakerEditorUtils.CopyTextToClipboard(DataMakerXmlUtils.XmlNodeToString(entry.Value));
                }

                if (GUILayout.Button("x", GUILayout.Width(30)))
                {
                    DataMakerXmlUtils.DeleteXmlNodeReference(entry.Key);
                    GUIUtility.ExitGUI();
                    return;
                }

                GUILayout.EndHorizontal();

                if (xmlNodePreviews.Contains(entry.Key))
                {
                    OnGUI_XmlNodeReferencePreview(entry.Key);
                }
            }
            GUILayout.EndVertical();
        }
        else
        {
            GUILayout.Label("- nothing yet -");
        }

        OnGUI_Title("XmlNodeList References");

        if (DataMakerXmlUtils.xmlNodeListLUT != null)
        {
            GUILayout.BeginVertical();
            foreach (KeyValuePair <string, XmlNodeList> entry in DataMakerXmlUtils.xmlNodeListLUT)
            {
                GUILayout.BeginHorizontal();

                if (GUILayout.Button(entry.Key))
                {
                    ToggleXmlNodeListPreview(entry.Key);
                }

                if (GUILayout.Button("Copy", GUILayout.Width(50)))
                {
                    PlayMakerEditorUtils.CopyTextToClipboard(DataMakerXmlUtils.XmlNodeListToString(entry.Value));
                }

                if (GUILayout.Button("x", GUILayout.Width(30)))
                {
                    DataMakerXmlUtils.DeleteXmlNodeReference(entry.Key);
                    GUIUtility.ExitGUI();
                    return;
                }

                GUILayout.EndHorizontal();

                if (xmlNodeListPreviews.Contains(entry.Key))
                {
                    OnGUI_XmlNodeListReferencePreview(entry.Key);
                }
            }
            GUILayout.EndVertical();
        }
        else
        {
            GUILayout.Label("- nothing yet -");
        }


        GUILayout.EndScrollView();
    }
コード例 #7
0
 public static void CreateGlobalEventIfNecessary()
 {
     //   Debug.Log("CreateGlobalEventIfNecessary");
     PlayMakerEditorUtils.CreateGlobalEventsIfNeeded(PlayMakerPunLUT.PhotonEvents.ToArray());
 }