本文整理汇总了C#中UnityEngine.Quaternion.FromVector4方法的典型用法代码示例。如果您正苦于以下问题:C# Quaternion.FromVector4方法的具体用法?C# Quaternion.FromVector4怎么用?C# Quaternion.FromVector4使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Quaternion
的用法示例。
在下文中一共展示了Quaternion.FromVector4方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExposeProperty
//.........这里部分代码省略.........
}
break;
case SerializedPropertyType.Vector4:
{
var getter = me.target.GetPropertyGetter<object, Vector4>(info);
Vector4 val = EditorGUILayout.Vector4Field(name, getter());
if (info.CanWrite)
{
var setter = me.target.GetPropertySetter<object, Vector4>(info);
setter(val);
}
}
break;
//case SerializedPropertyType.ArraySize:
//{
// //Will work out later. Will need to be recursive most likely.
// //var getter = me.target.GetPropertyGetter<object, Vector4>(info);
// //Vector4 val = EditorGUILayout.(name, getter());
// //if (info.CanWrite)
// //{
// // var setter = me.target.GetPropertySetter<object, Vector4>(info);
// // setter(val);
// //}
//}
//break;
case SerializedPropertyType.AnimationCurve:
{
var getter = me.target.GetPropertyGetter<object, AnimationCurve>(info);
AnimationCurve val = EditorGUILayout.CurveField(name, getter());
if (info.CanWrite)
{
var setter = me.target.GetPropertySetter<object, AnimationCurve>(info);
setter(val);
}
}
break;
case SerializedPropertyType.Bounds:
{
var getter = me.target.GetPropertyGetter<object, Bounds>(info);
Bounds val = EditorGUILayout.BoundsField(name, getter());
if (info.CanWrite)
{
var setter = me.target.GetPropertySetter<object, Bounds>(info);
setter(val);
}
}
break;
//case SerializedPropertyType.Gradient:
//{
// //Will work out later
// //var getter = me.target.GetPropertyGetter<object, Gradient>(info);
// //Gradient val = EditorGUILayout.(name, getter());
// //if (info.CanWrite)
// //{
// // var setter = me.target.GetPropertySetter<object, Gradient>(info);
// // setter(val);
// //}
//}
//break;
case SerializedPropertyType.Quaternion:
{
var getter = me.target.GetPropertyGetter<object, Quaternion>(info);
Quaternion val = new Quaternion();
val.FromVector4(EditorGUILayout.Vector4Field(name, getter().ToVector4()));
if (info.CanWrite)
{
var setter = me.target.GetPropertySetter<object, Quaternion>(info);
setter(val);
}
}
break;
//The draw function for the type must be exposed using the ExposeDrawFunction attribute.
case SerializedPropertyType.Generic:
default:
{
var propType = info.PropertyType;
if (TypeDrawFunctions.ContainsKey(propType))
{
var rect = EditorGUILayout.GetControlRect();
var val = info.GetGetMethod().Invoke(me.target, EmptyObjectArray);
var contentName = new GUIContent();
contentName.text = name;
val = TypeDrawFunctions[propType](rect, val, contentName, info);
if (info.CanWrite)
{
if(!propType.IsValueType)
{
info.SetValue(me.target, val, EmptyObjectArray);
}
else
{
info.SetValue(me.target, ((ReferenceType)val).GetValue(), EmptyObjectArray);
}
}
}
}
break;
}
GUI.enabled = true;
}