static void OnInspectorGUI_Vector3 (string btn, SerializedProperty property, Vector3 defaultValue, IVector3Property propertyDelegate) { bool changed; Vector3 newValue; var rect = GetControlRectOneLine(); var btnRect = rect; btnRect.width = btnRect.height+3; if (GUI.Button(btnRect, btn)) { newValue = defaultValue; changed = true; } else { var vectorRect = rect; vectorRect.x = btnRect.xMax+3; vectorRect.width -= btnRect.width+3; EditorGUI.BeginChangeCheck(); EditorGUI.showMixedValue = property.hasMultipleDifferentValues; newValue = EditorGUI.Vector3Field (vectorRect, "", propertyDelegate.GetValue(property)); EditorGUI.showMixedValue = false; changed = EditorGUI.EndChangeCheck (); } if (changed) { propertyDelegate.SetValue(property, newValue); } }
static public Tweener <Vector3, _V3Helper> To(IVector3Property property, Vector3 to, float duration, bool scalable = true) { Tweener <Vector3, _V3Helper> tweener = _vector3Tweeners.Get(); tweener.IncRef(); var aniMgr = TimerMgr._Instance; tweener.SetParams(property, scalable? aniMgr._Time : aniMgr._RealTime , duration, property.GetValue(), to - property.GetValue(), scalable); tweener.Start(); return(tweener); }
public void Detach() { _property = null; }
public void Attach(IProperty property) { _property = property as IVector3Property; }