Пример #1
0
        protected void DrawExporters()
        {
            GUILayout.BeginVertical();
            GUILayout.BeginHorizontal();
            if (exportsOpen)
            {
                if (GUILayout.Button("-", GUILayout.Width(30)))
                {
                    exportsOpen = false;
                }
            }
            else
            {
                if (GUILayout.Button("+", GUILayout.Width(30)))
                {
                    exportsOpen = true;
                }
            }

            GUILayout.Label("<b>EXPORT</b>");
            GUILayout.EndHorizontal();

            if (exportsOpen)
            {
                if (GUILayout.Button("Dump selected Effects\n to log", GUILayout.Width(150f), GUILayout.Height(60)))
                {
                    Utils.Log(selectedModule.Export().ToString());
                }
                if (GUILayout.Button("Copy selected Effects\n to clipboard", GUILayout.Width(150f), GUILayout.Height(60)))
                {
                    GUIUtility.systemCopyBuffer = (selectedModule.Export().ToString());
                }
                if (GUILayout.Button("Copy selected Effects\n as template to \nclipboard", GUILayout.Width(150f), GUILayout.Height(60)))
                {
                    ConfigNode node = new ConfigNode(WaterfallConstants.TemplateLibraryNodeName);
                    node.AddValue("templateName", templateName);
                    foreach (WaterfallEffect fx in selectedModule.FX)
                    {
                        node.AddNode(fx.Save());
                    }

                    GUIUtility.systemCopyBuffer = (node.ToString());
                }
                if (GUILayout.Button("Copy template offset\nvalues to clipboard", GUILayout.Width(150f), GUILayout.Height(60)))
                {
                    string copiedString = "";
                    copiedString += $"position = {modelOffset.x},{modelOffset.y},{modelOffset.z}\n";
                    copiedString += $"rotation = {modelRotation.x}, {modelRotation.y}, {modelRotation.z}\n";
                    copiedString += $"scale = {modelScale.x}, {modelScale.y}, {modelScale.z}";

                    GUIUtility.systemCopyBuffer = copiedString;
                }
            }
            GUILayout.EndVertical();
        }
Пример #2
0
 protected void DrawExporters()
 {
     GUILayout.BeginVertical();
     if (GUILayout.Button("Dump all to log"))
     {
         for (int i = 0; i < effectsModules.Count; i++)
         {
             Utils.Log(effectsModules[i].Export().ToString());
         }
     }
     if (GUILayout.Button("Dump selected to log"))
     {
         Utils.Log(selectedModule.Export().ToString());
     }
     if (GUILayout.Button("Copy selected to clipboard"))
     {
         GUIUtility.systemCopyBuffer = (selectedModule.Export().ToString());
     }
     GUILayout.EndVertical();
 }