Пример #1
0
		protected void DrawFromToAngles()
		{
			if (_formQuaternion != _fromProperty.quaternionValue)
			{
				_formQuaternion = _fromProperty.quaternionValue;
				_fromAngle = _formQuaternion.eulerAngles;
			}

			if (_toQuaternion != _toProperty.quaternionValue)
			{
				_toQuaternion = _toProperty.quaternionValue;
				_toAngle = _toQuaternion.eulerAngles;
			}

			EditorKit.RecordAndSetLabelWidth(EditorGUIUtility.currentViewWidth * 0.2f);
			EditorKit.RecordAndSetWideMode(true);

			EditorGUI.BeginChangeCheck();
			_fromAngle = EditorGUILayout.Vector3Field("From", _fromAngle);
			if (EditorGUI.EndChangeCheck())
			{
				_fromProperty.quaternionValue = _formQuaternion = Quaternion.Euler(_fromAngle);
			}

			EditorGUI.BeginChangeCheck();
			_toAngle = EditorGUILayout.Vector3Field("To", _toAngle);
			if (EditorGUI.EndChangeCheck())
			{
				_toProperty.quaternionValue = _toQuaternion = Quaternion.Euler(_toAngle);
			}

			EditorKit.RestoreLabelWidth();
			EditorKit.RestoreWideMode();
		}