Пример #1
0
		void OnEnable()
		{
			InitializedPrefsIfNeeded();

			_recordVideo = FindOrCreateRecordVideo();

			_gui = new GUIVertical();

			_gui.Add( new GUIButton( new GUIContent( FFmpegPathButtonText(), FFmpegPathButtonText()), PickFFmpegPathClicked));
			_gui.Add( new GUIButton( new GUIContent( OutputFolderButtonText(), OutputFolderButtonText()), PickOutputFolderClicked));
			_gui.Add( new GUIIntSlider( new GUIContent( "Super Size", 
														"Frames will be rendered at this multiple of the current resolution"), 
										_recordVideo.superSize, 1, 4, SuperSizeChanged));
			_gui.Add( new GUIIntSlider( new GUIContent( "Framerate", 
														"The fixed framerate of recorded video"), 
										_recordVideo.captureFramerate, 10, 60, FramerateChanged));
			_gui.Add( new GUIEnumPopup( new GUIContent( "Output Format"), 
										(OutputFormat) EditorPrefs.GetInt( OutputFormatPrefsKey), 
										OutputFormatChanged));
			GUIToggle deleteFrames = _gui.Add( new GUIToggle( new GUIContent( "Delete Frames", 
																			  "Delete all frames after compiling videos"), 
											   DeleteFramesChanged)) as GUIToggle;
			deleteFrames.isToggled = EditorPrefs.GetBool( DeleteFramesPrefsKey);
			_gui.Add( new GUISpace());
			_gui.Add( new GUIEnumPopup( new GUIContent( "Record Hotkey", "The key that will toggle recording during play mode"),
										(KeyCode) EditorPrefs.GetInt( RecordHotkeyPrefsKey), 
										RecordHotkeyChanged));
			_recordButton = _gui.Add( new GUIButton( new GUIContent( "Record"), RecordClicked)) as GUIButton;
			_recordButton.isEnabled = EditorApplication.isPlaying;

			EditorApplication.playmodeStateChanged += PlayModeStateChanged;
		}
Пример #2
0
		public void RefreshList( GameObject gameObject)
		{
			_gui = new GUIVertical();

			if( gameObject == null)
			{
				_gui.Add( new GUILabel( new GUIContent( "Select a GameObject to edit it's component list.")));
			}
			else
			{
				_gui.Add( new GUIButton( new GUIContent( "Highlight " + gameObject.name), HighlightSelectedGameObjectClicked));

				GUIScrollView scrollView = new GUIScrollView();
				_gui.Add( scrollView);

				Component[] components = gameObject.GetComponents<Component>();
				int index = 0;
				int maxIndex = Math.Max( 0, components.Length - 1);
				foreach( Component component in components)
				{
					GUIContent componentName = new GUIContent( component.GetType().Name);
					GUIDelayedIntField field = new GUIDelayedIntField( componentName, 
																	   index++, 
																	   1,
																	   maxIndex,
																	   ComponentIndexChanged);
					
					// Transform is always first component & can't be reordered
					field.isEnabled = index > 1;

					scrollView.Add( field);
				}
			}

			Repaint();
		}
Пример #3
0
		private void CreateGUI()
		{
			AssetUpdater updater = AssetUpdater.Instance;

			_gui = new GUIVertical();
			GUIScrollView scrollView = _gui.Add( new GUIScrollView()) as GUIScrollView;

			scrollView.Add( new GUILabel( new GUIContent( "Installed Assets")));


			GUIStyle style = EditorGUIUtility.isProSkin ? CreateBackgroundStyle( 55, 70) : 
				CreateBackgroundStyle( 170, 235);
			_assetUpdateLabels = new List<GUILabel>();
			_downloadButtons = new List<GUIButton>();

			GUIStyle statusStyle = new GUIStyle();
			statusStyle.margin = new RectOffset( 2, 4, 2, 2);
			statusStyle.normal.textColor = EditorGUIUtility.isProSkin ? new Color( 0.6f, 0.6f, 0.6f) :
				new Color( 0.4f, 0.4f, 0.4f);
			statusStyle.alignment = TextAnchor.MiddleRight;

			int count = updater.AssetCount;
			for( int i=0; i<count; i++)
			{
				AssetVersion localVersion = updater.GetLocalVersion( i);
				AssetVersion remoteVersion = updater.GetRemoteVersion( i);

				GUIHorizontal bar = scrollView.Add( new GUIHorizontal( style)) as GUIHorizontal;
				GUIVertical infoContainer = bar.Add( new GUIVertical()) as GUIVertical;
				infoContainer.Add( new GUILabel( new GUIContent( localVersion.Name + " (" + localVersion.Version + ")")));
				infoContainer.Add( new GUILabel( new GUIContent( localVersion.Author)));

				string labelText = UpdateTextForVersion( localVersion, remoteVersion);

				GUIVertical updateContainer = bar.Add( new GUIVertical()) as GUIVertical;
				GUILabel label = updateContainer.Add( new GUILabel( new GUIContent( labelText))) as GUILabel;
				label.style = statusStyle;

				GUIHorizontal buttonsContainer = updateContainer.Add( new GUIHorizontal()) as GUIHorizontal;
				GUIButton button = buttonsContainer.Add( new GUIButton( new GUIContent( "Release Notes"), 
																		ReleaseNotesButtonPressed)) as GUIButton;
				button.tag = i;

				button = buttonsContainer.Add( new GUIButton( new GUIContent( "Download"), 
															  DownloadButtonPressed)) as GUIButton;
				button.tag = i;
				button.isHidden = remoteVersion == null || 
								  (localVersion.Version < remoteVersion.Version) == false;

				_assetUpdateLabels.Add( label);
				_downloadButtons.Add( button);
			}

			GUIHorizontal refreshContainer = scrollView.Add( new GUIHorizontal()) as GUIHorizontal;
			refreshContainer.Add( new GUISpace( true));
			refreshContainer.Add( new GUIButton( new GUIContent( "Refresh"), RefreshButtonPressed));
		}