public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(MovementType); GUILayout.Space(10); EditorGUILayout.PropertyField(Movement); _iTweenMagic = (ITweenMagic)target; if (Movement.boolValue && MovementType.enumValueIndex == 0) { GUILayout.BeginVertical("box"); EditorGUILayout.PropertyField(LoopTypeMovement); EditorGUILayout.PropertyField(EaseTypeMovement); InitialPosition3DFunction(); TargetPosition3DFunction(); //EditorGUILayout.PropertyField(TargetPosition3D); EditorGUILayout.PropertyField(timeMovement); EditorGUILayout.PropertyField(delayMovement); EditorGUILayout.PropertyField(MovementTweenCompletionEvent); GUILayout.EndVertical(); } else if (Movement.boolValue && MovementType.enumValueIndex == 1) { GUILayout.BeginVertical("box"); EditorGUILayout.PropertyField(LoopTypeMovement); EditorGUILayout.PropertyField(EaseTypeMovement); InitialPosition2DFunction(); TargetPosition2DFunction(); EditorGUILayout.PropertyField(timeMovement); EditorGUILayout.PropertyField(delayMovement); EditorGUILayout.PropertyField(MovementTweenCompletionEvent); // GUILayout.Space(20); GUILayout.EndVertical(); } EditorGUILayout.PropertyField(Rotation); if (Rotation.boolValue) { GUILayout.BeginVertical("box"); EditorGUILayout.PropertyField(LoopTypeRotation); EditorGUILayout.PropertyField(EaseTypeRotation); InitialRotationFunction(); TargetRotationFunction(); //EditorGUILayout.PropertyField(TargetRotation); EditorGUILayout.PropertyField(timeRotation); EditorGUILayout.PropertyField(delayRotation); EditorGUILayout.PropertyField(RotationTweenCompletionEvent); GUILayout.EndVertical(); } EditorGUILayout.PropertyField(Scale); if (Scale.boolValue) { GUILayout.BeginVertical("box"); EditorGUILayout.PropertyField(LoopTypeScale); EditorGUILayout.PropertyField(EaseTypeScale); InitialScaleFunction(); TargetScaleFunction(); EditorGUILayout.PropertyField(timeScale); EditorGUILayout.PropertyField(delayScale); EditorGUILayout.PropertyField(ScaleTweenCompletionEvent); GUILayout.EndVertical(); } serializedObject.ApplyModifiedProperties(); }
void Start() { inArea = true; intialPositon = this.gameObject.transform.localPosition; iTween = this.gameObject.GetComponent <ITweenMagic> (); }