コード例 #1
0
		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);
			}
		}
コード例 #2
0
ファイル: TweenMgr.cs プロジェクト: wyyayy/ARPainting
        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);
        }
コード例 #3
0
 public void Detach()
 {
     _property = null;
 }
コード例 #4
0
 public void Attach(IProperty property)
 {
     _property = property as IVector3Property;
 }