SelectAll() public method

public SelectAll ( ) : void
return void
コード例 #1
0
ファイル: CopySeed.cs プロジェクト: Daniel95/Mythe
 public void CopyToClipBoard()
 {
     TextEditor te = new TextEditor();
     te.text = seedValue.Seed;
     te.SelectAll();
     te.Copy();
 }
コード例 #2
0
	public void sendClick (GPSDefinition.GPSPoint point) { //Pass it on
		cameraObject.SendMessage("moveToObserve", point);
		TextEditor te = new TextEditor ();
		te.content = new GUIContent (point.originalGPS);
		te.SelectAll ();
		te.Copy ();
	}
コード例 #3
0
 public void OnGUI()
 {
     EditorGUILayout.LabelField(new GUIContent("Insert Thai message here."));
     EditorGUI.BeginChangeCheck();
     message = EditorGUILayout.TextArea(message);
     if (EditorGUI.EndChangeCheck())
     {
         if (!string.IsNullOrEmpty(message))
         {
             thaiMessage = ThaiFontAdjuster.Adjust(message);
         }
         else
         {
             thaiMessage = "";
         }
     }
     EditorGUILayout.LabelField(new GUIContent("Output."));
     EditorGUILayout.TextArea(thaiMessage);
     if (GUILayout.Button("Copy"))
     {
         UnityEngine.TextEditor t = new UnityEngine.TextEditor();
         t.text = thaiMessage;
         t.SelectAll();
         t.Copy();
     }
 }
コード例 #4
0
 /// <summary>
 /// Copies the string to the OS buffer.
 /// </summary>
 /// <param name="copyString">String to copy.</param>
 public static void CopyStringToBuffer(string copyString)
 {
     TextEditor te = new TextEditor();
     te.text = copyString;
     te.SelectAll();
     te.Copy();
 }
コード例 #5
0
 void CopyText(string pText)
 {
     TextEditor editor = new TextEditor();
     editor.content = new GUIContent(pText);
     editor.SelectAll();
     editor.Copy();
 }
コード例 #6
0
 public void CopyToClipboard(string value)
 {
   TextEditor textEditor = new TextEditor();
   textEditor.text = value;
   textEditor.SelectAll();
   textEditor.Copy();
 }
コード例 #7
0
ファイル: Overlay.cs プロジェクト: CYBUTEK/AVC
        /// <summary>
        ///     Draws a button that when clicked copies game and add-on details to the clipboard.
        /// </summary>
        private static void CopyToClipboardButton()
        {
            // Draw a GUI button.
            if (GUILayout.Button("Copy to Clipboard"))
            {
                // Create a text string and populate the first line with the game details.
                string copyText = "KSP: " + VersionObject.KspVersion + " - " +
                                  "Unity: " + Application.unityVersion + " - " +
                                  "OS: " + SystemInfo.operatingSystem;

                // Iterate over all the loaded add-ons.
                for (int i = 0; i < AddonLibrary.LoadedAddons.Count; ++i)
                {
                    Addon addon = AddonLibrary.LoadedAddons[i];
                    if (addon != null)
                    {
                        // Append the add-on details to the clipboard string.
                        copyText = copyText + Environment.NewLine + addon.Name + " - " + addon.LocalVersionString;
                    }
                }

                // Create a text editor for use with copying the copy text onto the clipboard.
                TextEditor textEditor = new TextEditor
                {
                    // Set the content of the text editor to the copy text.
                    content = new GUIContent(copyText)
                };

                // Copy text to the clipboard.
                textEditor.SelectAll();
                textEditor.Copy();
            }
        }
コード例 #8
0
ファイル: CopyAttributeEditor.cs プロジェクト: fengqk/Art
	static void CopyTR()
	{

		var sels = Selection.GetFiltered(typeof(Transform), SelectionMode.Unfiltered);

		string info = "";
		int index = 0;
		sels = SortSels(sels);
		
		foreach (var s in sels)
		{
			Transform t = s as Transform;
			Vector3 pos = t.position;
			Vector3 rot = t.rotation.eulerAngles;
			if (index != 0)
			{
				info += "\n";
			}
			info += string.Format("{1:F2}\t{2:F2}\t{3:F2}\t", info, pos.x, pos.y, pos.z);
			info += string.Format("{1:F2}\t {2:F2}\t{3:F2}", info, rot.x, rot.y, rot.z);
			index++;
		}
		
		TextEditor tempEditor = new TextEditor();
		tempEditor.content = new GUIContent(info);
		tempEditor.SelectAll();
		tempEditor.Copy();
		tempEditor = null;

		Debug.Log("Copy TR");
	}
コード例 #9
0
ファイル: UILogger.cs プロジェクト: CoryBerg/drexelNeonatal
 public void CopyText()
 {
     TextEditor te = new TextEditor();
     te.content = new GUIContent(ToCSV());
     te.SelectAll();
     te.Copy();
 }
コード例 #10
0
 internal static void CopyTextToClipboard(String CopyText)
 {
     TextEditor t = new TextEditor();
     t.content = new GUIContent(CopyText);
     t.SelectAll();
     t.Copy();
 }
コード例 #11
0
 public void copyText()
 {
     TextEditor text = new TextEditor();
     text.content = new GUIContent(custom.exportSong());
     text.SelectAll();
     text.Copy();
 }
コード例 #12
0
    public static void PutTextToClipboard(string str)
    {
        var te = new UnityEngine.TextEditor();

        te.text = str;
        te.SelectAll();
        te.Copy();
    }
コード例 #13
0
 public void CopyToClipboard(string value)
 {
     TextEditor editor = new TextEditor {
         content = new GUIContent(value)
     };
     editor.SelectAll();
     editor.Copy();
 }
コード例 #14
0
 public void CopyToClipboard(string value)
 {
     TextEditor editor = new TextEditor {
         text = value
     };
     editor.SelectAll();
     editor.Copy();
 }
コード例 #15
0
ファイル: Clipboard.cs プロジェクト: almyu/ld33
        public static void SetText(string text)
        {
            if (string.IsNullOrEmpty(text)) return;

            var ed = new TextEditor();
            ed.content = new GUIContent(text);
            ed.SelectAll();
            ed.Copy();
        }
コード例 #16
0
ファイル: FaceControllerGUI.cs プロジェクト: HASParty/ggpai
 void CopyPose()
 {
     string str = "<EXPRESSION_NAME_HERE>"+System.Environment.NewLine;
     foreach (string bone in pose.Keys) {
         if(pose[bone]["X"] != 0f || pose[bone]["Y"] != 0f || pose[bone]["Z"] != 0f) {
             str+=bone+","+pose[bone]["X"]+","+pose[bone]["Y"]+","+pose[bone]["Z"]+System.Environment.NewLine;
         }
     }
     TextEditor te = new TextEditor();
     te.text = str;
     te.SelectAll();
     te.Copy();
 }
コード例 #17
0
		public static void CopyTextToClipboard(string text)
		{
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBPLAYER
			var textEditor = new TextEditor {content = new GUIContent(text)};
			textEditor.SelectAll();
			textEditor.Copy();
#elif UNITY_IOS 
			_opencodingConsoleCopyToClipboard(text);
#elif UNITY_ANDROID
			AndroidJavaClass androidJavaClass = new AndroidJavaClass("net.opencoding.console.NativeMethods");
			androidJavaClass.CallStatic("copyToClipboard", text);
#else
			Debug.LogError("Copy and paste isn't supported on this platform currently. Please contact [email protected] and I'll do my best to support it!");
#endif
		}
コード例 #18
0
ファイル: MapAreaInspector.cs プロジェクト: fengqk/Art
	void CopyToClipboard()
	{
		string info = "";
		int childrenCount = thisTarget.transform.childCount;

		for (int i = 0; i < childrenCount; i++)
		{
			Vector3 pos = thisTarget.transform.GetChild(i).position;
			info += string.Format("{1:F2}\t{2:F2}\t{3:F2}\n", info, pos.x, pos.y, pos.z);
		}

		if (childrenCount > 2 && thisTarget.isLoop) {
			Vector3 pos = thisTarget.transform.GetChild(0).position;
			info += string.Format("{1:F2}\t{2:F2}\t{3:F2}\n", info, pos.x, pos.y, pos.z);
		}


		TextEditor tempEditor = new TextEditor();
		tempEditor.content = new GUIContent(info);
		tempEditor.SelectAll();
		tempEditor.Copy();
		tempEditor = null;
	}
コード例 #19
0
ファイル: GameManagerScript.cs プロジェクト: Lrss/P3
    void OnGUI()
    {
        GUI.skin = guiSkin;
        GUI.Label(new Rect(Screen.width / 15 + 90, Screen.height / 6, 200, 100), "Points: " + pointsGained);
        GUI.Label(new Rect(Screen.width / 15, Screen.height / 6 + 100, 400, 100), buildString(gameOverMinutes, gameOverSeconds));

        if (menuKickEminent)
        {
            TextEditor te = new TextEditor();
            te.content = new GUIContent(data);
            te.SelectAll();
            te.Copy();
            //GUI Stuff.
            GUI.skin = guiSkin;
            GUI.BeginGroup(new Rect(Screen.width / 2 - bootscreenBG.width / 2, Screen.height / 2 - bootscreenBG.height / 2, bootscreenBG.width, bootscreenBG.height));
            GUI.Box(new Rect(0, 0, bootscreenBG.width, bootscreenBG.height), bootscreenBG);
            GUI.Label(new Rect(bootscreenBG.width / 2 - 100, bootscreenBG.height / 3 - 40, 200, 100), pointsGained.ToString() + " points gained!");
            //GUI.Label(new Rect(bootscreenBG.width / 2 - 100, (bootscreenBG.height / 3) * 2 - 40, 200, 100), "Time to get first points: " + firstPointGained + " seconds");
            GUI.EndGroup();
            //Debug.Break();
        }
    }
コード例 #20
0
ファイル: NetUIScript.cs プロジェクト: adenlb/FTJ
	void CopyTextToClipboard(string str){	
		TextEditor te = new TextEditor();
		te.content = new GUIContent(str);
		te.SelectAll();
		te.Copy();
	}
コード例 #21
0
        public void CopyButtonClicked()
        {
            SeedInputField.text = lastSeed.ToString();
            TextEditor te = new TextEditor();
            string copyText = string.Format(scriptTemplate,
                BoltCountSlider.value,
                DurationSlider.value,
                SeedInputField.text,
                lastStart.x, lastStart.y, lastStart.z,
                lastEnd.x, lastEnd.y, lastEnd.z,                
                GenerationsSlider.value,
                ChaosSlider.value,
                TrunkWidthSlider.value,
                GlowIntensitySlider.value,
                GlowWidthSlider.value,
                ForkednessSlider.value,
                FadePercentSlider.value,
                GrowthMultiplierSlider.value
            );

#if UNITY_4 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2

            // Unity Pre 5.3:
            te.content = new GUIContent(copyText);

#else

            te.text = copyText;

#endif

            te.SelectAll();
            te.Copy();
        }
コード例 #22
0
 public void LatLonClipbardCopy()
 {
     if (GUILayout.Button("Copy Lat/Lon/Alt to Clipboard"))
     {
         TextEditor te = new TextEditor();
         string result = "latitude =  " + vesselState.latitude.ToString("F6") + "\nlongitude = " + vesselState.longitude.ToString("F6") +
                         "\naltitude = " + vessel.altitude.ToString("F2") + "\n";
         te.content = new GUIContent(result);
         te.SelectAll();
         te.Copy();
     }
 }
コード例 #23
0
        private void BlockInfo(int id)
        {
            BlockBehaviour bb = block.GetComponent<BlockBehaviour>();
            GUILayout.Label("Name: " + block.name);
            GUILayout.Label("ID: " + bb.GetBlockID());
            GUILayout.Label("GUID: " + bb.Guid);
            GUILayout.Space(25.0f);

            if (GUILayout.Button(new GUIContent("Copy to Clipboard", "Copies the GUID to the Clipboard")))
            {
                TextEditor te = new TextEditor {content = new GUIContent(bb.Guid.ToString())};
                te.SelectAll();
                te.Copy();
            }

            if (GUILayout.Button(new GUIContent("Close", "Closes the Block Info Window")))
            {
                _bInfo = false;
            }
            LastTooltip = GUI.tooltip;
            GUI.DragWindow();
        }
コード例 #24
0
    void OnGUI()
    {
        position = new Rect(position.x, position.y, 420, 340);

        switch(_tourStep)
        {
        case 0:
            GUILayout.Label("Thank you for downloading the GameAnalytics Unity3D wrapper", EditorStyles.whiteLargeLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("By using GameAnalytics you will be able to find out what type of players play your game, how they play, and lots more!", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("This Setup Wizard will help you set up GameAnalytics, and teach you how to track system events, crashes, custom events, etc. You will also learn how to use heatmaps to visualize your data!", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Jump to Setup:", EditorStyles.boldLabel);
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button(_stepOne)) { _tourStep = 1; }
            if (GUILayout.Button(_stepTwo)) { _tourStep = 2; }
            if (GUILayout.Button(_stepThree)) { _tourStep = 3; }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Jump to Tracking:", EditorStyles.boldLabel);
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button(_stepFour)) { _tourStep = 4; }
            if (GUILayout.Button(_stepFive)) { _tourStep = 5; }
            if (GUILayout.Button(_stepSix)) { _tourStep = 6; }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Jump to Heatmaps:", EditorStyles.boldLabel);
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button(_stepSeven)) { _tourStep = 7; }
            if (GUILayout.Button(_stepEight)) { _tourStep = 8; }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Visit the online documentation:", EditorStyles.boldLabel);
            if (GUILayout.Button(_documentationLink, GUILayout.Width(150)))
            {
                Application.OpenURL("http://easy.gameanalytics.com/SupportDocu");
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            GUILayout.Space(4);

            break;
        case 1:
            GUILayout.Label("Step 1: Create your GA account and game", EditorStyles.whiteLargeLabel);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("The first thing you should do is create a GameAnalytics account on the GA website. Open the site using the button below, create and verify your GA account, and then you will be able to both create a game studio and add games to it.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Once you have created your first game on the website you will have what you need to continue this tour. If you have already created a GA account and a game you should skip this step.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("GA account creation website:", EditorStyles.boldLabel);
            if (GUILayout.Button(_myHomePage, GUILayout.Width(150)))
            {
                Application.OpenURL("http://easy.gameanalytics.com/CreateGameAnalytics");
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(6);

            EditorGUILayout.HelpBox("The GA website lets you view all the data you have collected in a multitude of ways. Along with the Design, Quality, Business, and User views, which give you quick overviews of these aspects of your game, the GA site also features the Explore tool, Funnels and Cohorts.\n\nUsing the Explore tool you can visualize a ton of standard matrices, such as DAU (daily average users) or ARPU (average revenue per user), or custom matrices based on your own custom events.\nFunnels give you an overview of how users progress through a sequence of events you define, and Cohorts help you keep track of player retention.", MessageType.Info, true);

            GUILayout.Space(4);

            break;
        case 2:
            GUILayout.Label("Step 2: Setup GA settings", EditorStyles.whiteLargeLabel);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Now it's time to copy/paste your Game Key and Secret Key from the website to the fields below. These keys were generated when you created your game on the website. You can also find the keys under the game's settings from your home page.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Your keys are stored in the GA_Settings object, which also contains other useful settings - you can always find it under Window > GameAnalytics > Select GA_Settings.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("GA account home:", EditorStyles.boldLabel);
            if (GUILayout.Button(_myHomePage, GUILayout.Width(150)))
            {
                Application.OpenURL("http://easy.gameanalytics.com/LoginGA");
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            GUILayout.BeginHorizontal();
            GUILayout.Label(_publicKeyLabel, EditorStyles.boldLabel);
            GA.SettingsGA.GameKey = EditorGUILayout.TextField("", GA.SettingsGA.GameKey);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label(_privateKeyLabel, EditorStyles.boldLabel);
            GA.SettingsGA.SecretKey = EditorGUILayout.TextField("", GA.SettingsGA.SecretKey);
            GUILayout.EndHorizontal();

            EditorGUILayout.Space();

            EditorGUILayout.HelpBox("Your Game Key uniquely identifies your game, so the Unity Package knows where to store your data. Your Secret Key is used for security as message authorization, and makes sure that no-one else gets a hold of your data!", MessageType.Info, true);

            GUILayout.Space(31);

            break;
        case 3:
            GUILayout.Label("Step 3: The GA_Status Window", EditorStyles.whiteLargeLabel);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("A quick tip before we start tracking tons of events; the GA_Status window shows whether the GameAnalytics Unity3D Package has been set up correctly. Both the Game Key and Secret Key must be set up to satisfy the GA_Status window. This window is accessible through Window > GameAnalytics > Open GA_Status.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("The GA_Status window also shows the status of messages sent to the server. You get an overview of the total number of messages sent successfully, and the total number of messages that failed. The GA_Status window also shows you the number of successful/failed messages for each message category.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("To make sure the GA Package is tracking the events you set up it might be a good idea to keep an eye on this window while you play your game. Remember that messages are clustered and sent to the server at certain intervals (you can set this interval on the GA_Settings object, under the Advanced tab).", EditorStyles.wordWrappedLabel);

            GUILayout.Space(46);

            break;
        case 4:
            GUILayout.Label("Step 4: The GA_SystemTracker Prefab (Optional)", EditorStyles.whiteLargeLabel);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("The rest of this tour is completely optional - if you got this far you are ready to track events. Now you just need to set up some events to track!", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("The GA_SystemTracker is useful for tracking system info, errors, performance, etc. To add it to a scene go to Window > GameAnalytics > Create GA_SystemTracker.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("You can add a GA_SystemTracker to each of the scenes you want to track, or you can add a GA_SystemTracker to your first scene. Enable \"Use For Subsequent Levels\", and it will work for any scene that follows.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.HelpBox("It can be very useful to track how many levels players complete, and their completion times. The GA_SystemTracker will help you do this.\n\nThe GA_SystemTracker is also useful for gathering information on your players' system hardware. When you combine this with tracking game performance (average and Critical FPS events), you can get an overview of which system specifications have trouble running your game.\n\nYou can also use the GA_SystemTracker to track exceptions. This feature can generate a lot of data, but it can also be a great way of discovering bugs.", MessageType.Info, true);
            GUILayout.Space(7);

            break;
        case 5:
            GUILayout.Label("Step 5: The GA_Tracker Component (Optional)", EditorStyles.whiteLargeLabel);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("The GA_Tracker component can be added to any game object in a scene from Window > GameAnalytics > Add GA_Tracker to Object. It allows you to easily set up auto-tracking of a bunch of simple, predefined events for that game object.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.HelpBox("The auto-tracked events available through the GA_Tracker component lets you set up some simple tracking for testing, etc. without having to code your own custom events.", MessageType.Info, true);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Using the GA_Tracker you can also enable Track Target for a game object. Some key events used by the GA_SystemTracker will use the location of the game object set up as Track Target - so only one GA_Tracker per scene can have Track Target enabled. Events include Submit Critical FPS, Submit Errors, and GA GUI events.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.HelpBox("You can put a GA_Tracker component on your player or camera object, and enable Track Target. This way you will know the location of the player when a Critical FPS event occurred - there is probably something causing bad performance in that area!", MessageType.Info, true);
            GUILayout.Space(18);

            break;
        case 6:
            GUILayout.Label("Step 6: Tracking your own custom events (Optional)", EditorStyles.whiteLargeLabel);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("It is of course possible to track your own custom events, such as when a player kills an enemy, picks up an item, or dies. Here are a few simple copy/paste code examples, but we recommend you check out the online documentation for a complete overview.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Design examples:", EditorStyles.boldLabel);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.SelectableLabel("GA.API.Design.NewEvent(\"Kill:Robot\", transform.position);", EditorStyles.textField, new GUILayoutOption[] { GUILayout.Height(19) });
            if (GUILayout.Button(_copyCode, GUILayout.MaxWidth(82)))
            {
                TextEditor te = new TextEditor();
                te.content = new GUIContent("GA.API.Design.NewEvent(\"Kill:Robot\", transform.position);");
                te.SelectAll();
                te.Copy();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField("Quality example:", EditorStyles.boldLabel);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.SelectableLabel("GA.API.Quality.NewEvent(\"System:os\");", EditorStyles.textField, new GUILayoutOption[] { GUILayout.Height(19) });
            if (GUILayout.Button(_copyCode, GUILayout.MaxWidth(82)))
            {
                TextEditor te = new TextEditor();
                te.content = new GUIContent("GA.API.Quality.NewEvent(\"System:os\");");
                te.SelectAll();
                te.Copy();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField("Business example:", EditorStyles.boldLabel);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.SelectableLabel("GA.API.Business.NewEvent(\"Buy:PlayerSkin\", \"USD\", 10);", EditorStyles.textField, new GUILayoutOption[] { GUILayout.Height(19) });
            if (GUILayout.Button(_copyCode, GUILayout.MaxWidth(82)))
            {
                TextEditor te = new TextEditor();
                te.content = new GUIContent("GA.API.Business.NewEvent(\"Buy:PlayerSkin\", \"USD\", 10);");
                te.SelectAll();
                te.Copy();
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField("User example:", EditorStyles.boldLabel);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.SelectableLabel("GA.API.User.NewUser(GA_User.Gender.Male, 1976, 7);", EditorStyles.textField, new GUILayoutOption[] { GUILayout.Height(19) });
            if (GUILayout.Button(_copyCode, GUILayout.MaxWidth(82)))
            {
                TextEditor te = new TextEditor();
                te.content = new GUIContent("GA.API.User.NewUser(GA_User.Gender.Male, 1976, 7);");
                te.SelectAll();
                te.Copy();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(10);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Visit the online documentation:", EditorStyles.boldLabel);
            if (GUILayout.Button(_documentationLink, GUILayout.Width(150)))
            {
                Application.OpenURL("http://easy.gameanalytics.com/SupportDocu");
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(7);

            break;
        case 7:
            GUILayout.Label("Step 7A: 3D Heatmap data visualization (Optional)", EditorStyles.whiteLargeLabel);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("In order to use the heatmap feature you must first copy/paste your API Key from the website to the field below. You can find the key under your game's settings from your home page. Your API key is stored in the GA_Settings object, under the Advanced tab.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("GA account home:", EditorStyles.boldLabel);
            if (GUILayout.Button(_myHomePage, GUILayout.Width(150)))
            {
                Application.OpenURL("http://easy.gameanalytics.com/LoginGA");
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            GUILayout.BeginHorizontal();
            GUILayout.Label(_apiKeyLabel, EditorStyles.boldLabel);
            GA.SettingsGA.ApiKey = EditorGUILayout.TextField("", GA.SettingsGA.ApiKey);
            GUILayout.EndHorizontal();

            GUILayout.Space(3);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("To add a heatmap object to a scene go to Window > GameAnalytics > Create GA_Heatmap. Heatmaps. This allows you to visualize the data you have collected inside Unity3D.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("To use the GA_Heatmap prefab you first have to get your data from the GA servers. To do this click the Update Index button. This will update the available builds, areas, and events. After you select the appropriate values, which correspond to the event you want to visualize, you simply click the Download Heatmap button. If any data is present for the combination of values you have selected, you should now see a heatmap in your scene.", EditorStyles.wordWrappedLabel);

            GUILayout.Space(11);

            break;
        case 8:
            GUILayout.Label("Step 7B: 3D Heatmap data histogram (Optional)", EditorStyles.whiteLargeLabel);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("3D heatmaps come with a histogram of the downloaded dataset, which provides an overview of the data, and allows you to filter and focus on a smaller subset using the slider below the histogram.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("All data collected for heatmaps is aggregated into a grid. Each column in the histogram represents a frequency of occurrence for the event in a grid point. The height of the column indicates the number of grid points with this frequency. The column furthest to the left represents the lowest frequency, i.e. the number of grid points where this event only occurred a few times. The column furthest to the right represents the highest frequency.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Histogram scale switches between a linear and logarithmic view of the histogram, making it easier for you to focus on exactly the data you want.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Transparent render model gives a better overview of clustered data, while solid varies the size of each data point depending on the value. The overlay option allows you to view the heatmap through any other scene objects.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Point radius sets the size of each heatmap data point, and Show values will display the values of each data point (this can be bad for performance).", EditorStyles.wordWrappedLabel);

            GUILayout.Space(11);

            break;
        case 9:
            EditorGUILayout.LabelField("That's it!", EditorStyles.whiteLargeLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Of course, this tour only covered the basics of the Unity3D Package. For a complete overview, as well as examples, please visit our online documentation.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("You might also want to check out the example game included with the GA Package. You can find the scene in the Examples folder.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Once again, thank you for choosing GameAnalytics, and please do not hesitate to use the Support feature on our website (found on left side of the screen when you are logged in) to submit any feedback, or ask any questions you might have.", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Happy tracking!", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Visit your GA home page:", EditorStyles.boldLabel);
            if (GUILayout.Button(_myHomePage, GUILayout.Width(150)))
            {
                Application.OpenURL("http://easy.gameanalytics.com/LoginGA");
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Visit the online documentation:", EditorStyles.boldLabel);
            if (GUILayout.Button(_documentationLink, GUILayout.Width(150)))
            {
                Application.OpenURL("http://easy.gameanalytics.com/SupportDocu");
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Open GA example game scene:", EditorStyles.boldLabel);
            if (GUILayout.Button(_openExampleGame, GUILayout.Width(150)))
            {
                if (EditorApplication.SaveCurrentSceneIfUserWantsTo())
                {
                    EditorApplication.OpenScene("Assets/GameAnalytics/Plugins/Examples/ga_example.unity");
                    Close();
                }
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(11);

            break;
        }

        EditorGUILayout.Space();

        EditorGUILayout.BeginHorizontal();
        if (_tourStep > 0 && GUILayout.Button(_backToStart))
        {
            _tourStep = 0;
        }
        if (_tourStep > 0 && GUILayout.Button(_prevTour))
        {
            _tourStep--;
            MoveToNewStepAction();
        }
        if ((_tourStep == 0 || _tourStep == _lastStep) && GUILayout.Button(_closeWizard))
        {
            Close();
        }
        if (_tourStep < _lastStep && GUILayout.Button(_nextTour))
        {
            _tourStep++;
            MoveToNewStepAction();
        }
        EditorGUILayout.EndHorizontal();
    }
コード例 #25
0
ファイル: Console.cs プロジェクト: PhilipMantrov/Jeka3
 public void copy(string[] args)
 {
     TextEditor te = new TextEditor();
     te.content = new GUIContent(GetLog());
     te.SelectAll();
     te.Copy();
 }
コード例 #26
0
// ReSharper disable UnusedMember.Local
        void OnGUI()
// ReSharper restore UnusedMember.Local
        {
            if (_doFocusOut)
            {
                _doFocusOut = false;
                GUIUtility.keyboardControl = 0;
            }

            EditorWindowContentWrapper.Start();

            if (null == PanelRenderer.ChromeStyle)
                PanelRenderer.ChromeStyle = StyleCache.Instance.PanelChromeSquared;

            PanelRenderer.RenderStart(GuiContentCache.Instance.PersistenceDebuggerPanelTitle, true);

            PanelContentWrapper.Start();

            if (PanelRenderer.ClickedTools.Count > 0)
            {
                if (PanelRenderer.ClickedTools.Contains("options"))
                {
                    PanelRenderer.ClickedTools.Remove("options");
                }
                ShowHelp = PanelRenderer.ClickedTools.Contains("help");
            }
            else
            {
                ShowHelp = false;
            }

            if (ShowHelp)
            {
                EditorGUILayout.HelpBox(Help.PersistenceDebugWindow, MessageType.Info, true);
            }

            EditorGUILayout.BeginHorizontal(StyleCache.Instance.Toolbar, GUILayout.Height(35));

            #region Refresh

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.Refresh, StyleCache.Instance.Button,
                GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                GUIUtility.keyboardControl = 0;
                ProcessInfo();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Abandon chages

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.AbandonChanges, StyleCache.Instance.Button,
                GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                PersistenceManager.Instance.AbandonChanges();
                HierarchyChangeProcessor.Instance.Reset();
                ProcessInfo();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Copy

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.CopyToClipboard, StyleCache.Instance.Button,
                GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                GUIUtility.keyboardControl = 0;
                TextEditor te = new TextEditor {content = new GUIContent(_text)};
                te.SelectAll();
                te.Copy();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            GUILayout.FlexibleSpace();

            #region Auto-update

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            bool oldAutoUpdate = GUILayout.Toggle(EditorSettings.PersistenceWindowAutoUpdate,
                EditorSettings.PersistenceWindowAutoUpdate ? GuiContentCache.Instance.AutoUpdateOn : GuiContentCache.Instance.AutoUpdateOff, 
                StyleCache.Instance.Toggle,
                GUILayout.ExpandWidth(false), GUILayout.Height(30));

            if (EditorSettings.PersistenceWindowAutoUpdate != oldAutoUpdate)
            {
                GUIUtility.keyboardControl = 0;
                EditorSettings.PersistenceWindowAutoUpdate = oldAutoUpdate;
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Write to log

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            bool oldWriteToLog = GUILayout.Toggle(EditorSettings.PersistenceWindowWriteToLog,
                GuiContentCache.Instance.WriteToLog, StyleCache.Instance.GreenToggle,
                GUILayout.ExpandWidth(false), GUILayout.Height(30));

            if (EditorSettings.PersistenceWindowWriteToLog != oldWriteToLog)
            {
                GUIUtility.keyboardControl = 0;
                EditorSettings.PersistenceWindowWriteToLog = oldWriteToLog;
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion
            
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(1);

            _scrollPosition = GUILayout.BeginScrollView(_scrollPosition, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            //GUILayout.Label(_text, StyleCache.Instance.NormalLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));

            GUI.SetNextControlName(TextAreaControlName);
            _textToDisplay = EditorGUILayout.TextArea(_textToDisplay, StyleCache.Instance.RichTextLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));

            bool isInFocus = GUI.GetNameOfFocusedControl() == TextAreaControlName;
            _textToDisplay = isInFocus ? _text : _richText;
            
            GUILayout.EndScrollView();
            
            RenderStatus(
                EditorSettings.WatchChanges ? 
                    (EditorApplication.isPlaying ? "Monitoring..." : "Will monitor in play mode.") : 
                    "Not monitoring.", 
                EditorSettings.WatchChanges && EditorApplication.isPlaying
            );

            PanelContentWrapper.End();

            PanelRenderer.RenderEnd();

            //GUILayout.Space(3);
            EditorWindowContentWrapper.End();
        }
コード例 #27
0
ファイル: UIManager.cs プロジェクト: NotYours180/Chess
	public void CopyPGNToClipboard() {
		string dateString = System.DateTime.Today.Year + "." + System.DateTime.Today.Month + "." + System.DateTime.Today.Day;
		string modeName = "Regular mode";
		if (GameManager.gameModeIndex > 0) {
			modeName = "Blindfold Training; level " + (GameManager.gameModeIndex);
		}

		string pgn = "";

		pgn += "[Event \"" +modeName+ "\"]\n";
		pgn += "[Site \"http://sebastian.itch.io/blindfoldchess\"]\n";
		pgn += "[Date \"" + dateString + "\"]\n";
		pgn += "[White \"Human\"]\n";
		pgn += "[Black \"Computer\"]\n";
		pgn += "[Result \"" + resultStringShorthand + "\"]\n";

		pgn += "\n" + PGNDisplay.GetGamePGN ();
		if (pgn [pgn.Length - 1] != ' ') {
			pgn += " ";
		}
		pgn += resultStringShorthand;

		TextEditor t = new TextEditor ();
		t.content = new GUIContent (pgn);
		t.SelectAll ();
		t.Copy ();
		Debug.Log (t.content.text);
	}
コード例 #28
0
ファイル: CI_gui.cs プロジェクト: linuxgurugamer/CraftImport
		private void Window (int id)
		{
			if (cfgWinData == false) {
				cfgWinData = true;
				newUseBlizzyToolbar = thisCI.configuration.useBlizzyToolbar;
				//newShowDrives = CI.configuration.showDrives;
				//newCkanExecPath = CI.configuration.ckanExecPath;
				craftURL = "";
				m_textPath = "";
				saveInSandbox = false;
				overwriteExisting = false;
				m_textPath = thisCI.configuration.lastImportDir;
				//		#if EXPORT
				//		for (int i = 0; i < actionGroups.Length; i++)
				//			actionGroups [i] = "";
				//		lastSelectedCraft = -1;
				//		#endif

//				byte[] colorPickerFileData = System.IO.File.ReadAllBytes (FileOperations.ROOT_PATH + "GameData/CraftImport/Textures/colorpicker_texture.jpg");

				byte[] colorPickerFileData = System.IO.File.ReadAllBytes (FileOperations.ROOT_PATH + "GameData/" + CI.TEXTURE_DIR + "/colorpicker_texture.jpg");
				colorPicker = new Texture2D (2, 2);
				colorPicker.LoadImage (colorPickerFileData); //..this will auto-resize the texture dimensions.

			} 

			SetVisible (true);
			GUI.enabled = true;

			GUILayout.BeginHorizontal ();
			GUILayout.EndHorizontal ();

			GUILayout.BeginVertical ();

			//	DrawTitle ("Craft Import");

			//Log.Info ("downloadState: " + downloadState.ToString ());
			switch (downloadState) {
#if EXPORT
			case downloadStateType.UPLOAD:
				uploadCase ();

				break;
			case downloadStateType.GET_DUP_CRAFT_LIST:
				getUpdateCraftList ();

				break;

			case downloadStateType.GET_THUMBNAIL:
				getThumbnailcase ();
				break;

			case downloadStateType.SELECT_DUP_CRAFT:
				selectDupCraftCase ();

				break;

			case downloadStateType.ACTIONGROUPS:
				GUILayout.BeginHorizontal ();
				GUILayout.Label ("Action Groups");
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();

				GUILayout.BeginHorizontal ();

				buildMenuScrollPosition = GUILayout.BeginScrollView (buildMenuScrollPosition, GUILayout.Width (WIDTH - 30), GUILayout.Height (HEIGHT * 2 / 3));
				GUILayout.BeginVertical ();


				for (int i = 0; i < 16; i++) {
					GUILayout.BeginHorizontal ();
					if (i < 10) {
						GUILayout.Label ((i + 1).ToString () + ":");
					} else {
						GUILayout.Label (fixedActions [i - 10]);
					}
					GUILayout.FlexibleSpace ();
					actionGroups [i] = GUILayout.TextField (actionGroups [i], GUILayout.MinWidth (50F), GUILayout.MaxWidth (300F));
					actionGroups [i] = actionGroups [i].Replace("\n", "").Replace("\r", "");
					GUILayout.EndHorizontal ();
				}
				GUILayout.EndVertical ();
				GUILayout.EndScrollView (); 
				GUILayout.EndHorizontal ();

				GUILayout.BeginHorizontal ();
				GUILayout.Label ("");
				GUILayout.EndHorizontal ();
				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				if (GUILayout.Button ("OK", GUILayout.Width (125.0f))) {
					
					downloadState = downloadStateType.UPLOAD;
				}
				GUILayout.FlexibleSpace ();

				GUILayout.EndHorizontal ();
				break;
#endif
				
			case downloadStateType.GUI:
				guiCase ();
				break;
#if EXPORT
			case downloadStateType.SHOW_WARNING:
				warningCase ();
				break;

//			case downloadStateType.FILESELECTION:
//				getFile ();
//				break;

			case downloadStateType.UPLOAD_IN_PROGRESS:
#endif
			case downloadStateType.IN_PROGRESS:
				Log.Info ("IN_PROGRESS");
				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				if (downloadState == downloadStateType.IN_PROGRESS)
					GUILayout.Label ("Download in progress");
				else
					GUILayout.Label ("Upload in progress");
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();

				GUILayout.BeginHorizontal ();
				GUILayout.Label ("");
				GUILayout.EndHorizontal ();

				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				if (downloadState == downloadStateType.IN_PROGRESS) {
					if (download != null)
						GUILayout.Label ("Progress: " + (100 * download.progress).ToString () + "%");
				}
				#if EXPORT
				else {
					if (Time.realtimeSinceStartup - lastUpdate > 1) {
						lastUpdate = Time.realtimeSinceStartup;
						uploadProgress++;
					}
					GUILayout.Label ("Upload progress: " + uploadProgress.ToString ());
				}
				#endif
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();

				GUILayout.BeginHorizontal ();
				GUILayout.Label ("");
				GUILayout.EndHorizontal ();

				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				if (GUILayout.Button ("Cancel", GUILayout.Width (125.0f))) {
					resetBeforeExit ();
				}
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();
				break;

				#if EXPORT
			case downloadStateType.UPLOAD_COMPLETED:
				#endif
			case downloadStateType.COMPLETED:
				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				if (downloadState == downloadStateType.COMPLETED)
					GUILayout.Label ("Download completed");
				else
					GUILayout.Label ("Upload completed");
				
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();
				GUILayout.BeginHorizontal ();
				GUILayout.Label ("", GUILayout.Height (10));
				GUILayout.EndHorizontal ();
				GUILayout.BeginHorizontal ();
				if (instructions.Trim () != "") {
					scrollPosition = GUILayout.BeginScrollView (
						scrollPosition, GUILayout.Width (WIDTH - 20), GUILayout.Height (HEIGHT - 100));
					GUILayout.Label (instructions);
					GUILayout.EndScrollView ();
				} else
					GUILayout.Label ("");
				GUILayout.EndHorizontal ();
				GUILayout.BeginHorizontal ();
				GUILayout.Label ("", GUILayout.Height (10));
				GUILayout.EndHorizontal ();
				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				if (GUILayout.Button ("OK", GUILayout.Width (125.0f))) {

					if (downloadState == downloadStateType.COMPLETED && loadAfterImport) {
						Log.Info ("saveFile: " + saveFile);
						if (!subassembly)
							EditorLogic.LoadShipFromFile (saveFile);
						else {
							if (EditorLogic.RootPart) 
								LoadCraftAsSubassembly (saveFile);
						//	ShipConstruct ship = ShipConstruction.LoadShip (craftURL);
						//	EditorLogic.SpawnConstruct (ship);
						}

					}
					resetBeforeExit ();
				}
				GUILayout.FlexibleSpace ();
				if (instructions != "") {
					if (GUILayout.Button ("Copy to clipboard")) {
						TextEditor te = new TextEditor ();
						te.text = instructions;
						te.SelectAll ();
						te.Copy ();
					}
					GUILayout.FlexibleSpace ();
				}
				GUILayout.EndHorizontal ();
				break;

			case downloadStateType.FILE_EXISTS:
				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				GUILayout.Label ("File Exists Error");
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();
				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				GUILayout.Label ("The craft file already exists, will NOT be overwritten");
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();
				GUILayout.BeginHorizontal ();
				if (GUILayout.Button ("OK", GUILayout.Width (125.0f))) {
					resetBeforeExit ();
				}
				GUILayout.EndHorizontal ();
				break;

				#if EXPORT
			case downloadStateType.UPLOAD_ERROR:
				#endif
			case downloadStateType.ERROR:
				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				if (downloadState == downloadStateType.ERROR)
					GUILayout.Label ("Download Error");
				else
					GUILayout.Label ("Upload Error");
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();
				GUILayout.BeginHorizontal ();
				GUILayout.FlexibleSpace ();
				#if EXPORT
				if (downloadState == downloadStateType.UPLOAD_ERROR)
					GUILayout.Label (uploadErrorMessage);
				else
				#endif
				GUILayout.Label (downloadErrorMessage);
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();
				GUILayout.BeginHorizontal ();
		#if EXPORT
				if (GUILayout.Button ("OK", GUILayout.Width (125.0f))) {
					downloadState = downloadStateType.UPLOAD;
				}
		#endif
				GUILayout.FlexibleSpace ();
				if (GUILayout.Button ("Cancel", GUILayout.Width (125.0f))) {
					resetBeforeExit ();
				}
				GUILayout.FlexibleSpace ();
				GUILayout.EndHorizontal ();
				break;

			default:
				break;
			}
			GUILayout.EndVertical ();
			GUI.DragWindow ();
		}
コード例 #29
0
// ReSharper disable UnusedMember.Local
        void OnGUI()
// ReSharper restore UnusedMember.Local
        {
            if (_doFocusOut)
            {
                _doFocusOut = false;
                GUIUtility.keyboardControl = 0;
            }

            EditorWindowContentWrapper.Start();

            if (null == PanelRenderer.ChromeStyle)
                PanelRenderer.ChromeStyle = StyleCache.Instance.PanelChromeSquared;

            PanelRenderer.RenderStart(GuiContentCache.Instance.HierarchyDebuggerPanelTitle, true);

            PanelContentWrapper.Start();

            if (PanelRenderer.ClickedTools.Count > 0)
            {
                if (PanelRenderer.ClickedTools.Contains("options"))
                {
                    PanelRenderer.ClickedTools.Remove("options");
                }
                ShowHelp = PanelRenderer.ClickedTools.Contains("help");
            }
            else
            {
                ShowHelp = false;
            }

            if (ShowHelp)
            {
                EditorGUILayout.HelpBox(Help.HierarchyDebugWindow, MessageType.Info, true);
            }

            EditorGUILayout.BeginHorizontal(StyleCache.Instance.Toolbar, GUILayout.Height(35));

            #region Refresh

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.Refresh, StyleCache.Instance.Button,
                GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                GUIUtility.keyboardControl = 0;
                ProcessInfo();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Fix

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            /*bool oldEnabled = GUI.enabled;
            GUI.enabled = !Application.isPlaying;*/
            if (GUILayout.Button(GuiContentCache.Instance.FixHierarchy, StyleCache.Instance.GreenToggle,
                GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                var text =
                    @"eDriven will look for adapters present in the hierarchy but not listed in any of the order lists, and add them as list children.

It will also remove adapters not present in the hierarchy from all of the order lists.";

                if (EditorApplication.isPlaying)
                {
                    text += @"

Note: The play mode will be stopped in order to fix the hierarchy.";
                }

                text += @"

Are you sure you want to do this?";

                if (EditorUtility.DisplayDialog("Fix hierarchy?", text, "OK", "Cancel"))
                {
                    if (EditorApplication.isPlaying)
                    {
                        // 1. delay fixing to after the stop
                        EditorState.ShouldFixHierarchyAfterStop = true;
                        // 2. stop the play mode
                        EditorApplication.isPlaying = false;
                    }
                    else // fix immediatelly
                    {
                        FixHierarchy();
                    }
                }
            }
            /*GUI.enabled = oldEnabled;*/

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Copy

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.CopyToClipboard, StyleCache.Instance.Button,
                GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                GUIUtility.keyboardControl = 0;
                TextEditor te = new TextEditor {content = new GUIContent(_description)};
                te.SelectAll();
                te.Copy();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            GUILayout.FlexibleSpace();

            #region Auto-update

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            bool oldAutoUpdate = GUILayout.Toggle(EditorSettings.HierarchyWindowAutoUpdate,
                EditorSettings.HierarchyWindowAutoUpdate ? GuiContentCache.Instance.AutoUpdateOn : GuiContentCache.Instance.AutoUpdateOff,
                StyleCache.Instance.Toggle,
                GUILayout.ExpandWidth(false), GUILayout.Height(30));

            if (EditorSettings.HierarchyWindowAutoUpdate != oldAutoUpdate)
            {
                GUIUtility.keyboardControl = 0;
                EditorSettings.HierarchyWindowAutoUpdate = oldAutoUpdate;
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Write to log

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            bool oldWriteToLog = GUILayout.Toggle(EditorSettings.HierarchyWindowWriteToLog,
                GuiContentCache.Instance.WriteToLog, StyleCache.Instance.GreenToggle,
                GUILayout.ExpandWidth(false), GUILayout.Height(30));

            if (EditorSettings.HierarchyWindowWriteToLog != oldWriteToLog)
            {
                GUIUtility.keyboardControl = 0;
                EditorSettings.HierarchyWindowWriteToLog = oldWriteToLog;
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            EditorGUILayout.EndHorizontal();

            GUILayout.Space(1);

            _scrollPosition = GUILayout.BeginScrollView(_scrollPosition, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            //GUILayout.Label(HierarchyState.Instance.State, StyleCache.Instance.NormalLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            //EditorGUILayout.TextArea("<color=#00ff00>miki</color>" + _description, StyleCache.Instance.RichTextLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            EditorGUILayout.TextArea(_descriptionRich, StyleCache.Instance.RichTextLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            GUILayout.EndScrollView();

            PanelContentWrapper.End();

            PanelRenderer.RenderEnd();

            //GUILayout.Space(3);
            EditorWindowContentWrapper.End();
        }
コード例 #30
0
ファイル: AssetsGUIDTools.cs プロジェクト: fengqk/Art
	void CopyToClipBoard(string str){
		TextEditor tempEditor = new TextEditor();
		tempEditor.content = new GUIContent(str);
		tempEditor.SelectAll();
		tempEditor.Copy();
	}
コード例 #31
0
		/// <summary>Copies the given text onto the system clipboard.</summary>
		public static void Copy(string text){
			TextEditor editor=new TextEditor();
			editor.content.text=text;
			editor.SelectAll();
			editor.Copy();
		}
コード例 #32
0
        private void CopyToClipboard()
        {
            if (!GUILayout.Button("Copy to Clipboard"))
            {
                return;
            }

            var kspVersion = AddonInfo.ActualKspVersion.ToString();
            if (Environment.OSVersion.Platform == PlatformID.Win32NT)
            {
                if (IntPtr.Size == 8)
                {
                    kspVersion += " (Win64)";
                }
                else
                {
                    kspVersion += " (Win32)";
                }
            }
            else
            {
                kspVersion += " (" + Environment.OSVersion.Platform + ")";
            }

            var copyText = "KSP: " + kspVersion +
                           " - Unity: " + Application.unityVersion +
                           " - OS: " + SystemInfo.operatingSystem +
                           this.addonList;

            var textEditor = new TextEditor
            {
                content = new GUIContent(copyText)
            };
            textEditor.SelectAll();
            textEditor.Copy();
        }