static public void DrawAnimationMoveNodeInspector(AnimationMoveNode animNode, AnimationMoveData data)
    {
        data.targetName = EditorGUILayout.TextField("Target Name", data.targetName);
        data.duration   = EditorGUILayout.Slider("duration( ms )", data.duration, 1f, 10000f);
        data.toX        = EditorGUILayout.Slider("toX", data.toX, -500f, 500f);
        data.waitUntilAnimationFinish = EditorGUILayout.Toggle("Wait next Until Finish", data.waitUntilAnimationFinish);
        data.toggleFromAmount         = EditorGUILayout.Toggle("Start From?", data.toggleFromAmount);
//		data.method = EditorGUILayout.Popup( "Method" , data.method , AnimationNode.methods );
        if (data.toggleFromAmount)
        {
            data.fromX = EditorGUILayout.Slider("fromX", data.fromX, -500f, 500f);
        }

        GUI.enabled = Application.isPlaying;

        if (GUILayout.Button("Preview"))
        {
            GameObject tgt = GameObject.Find(data.targetName);
            if (tgt != null)
            {
                AnimationMoveNode.Animate(animNode, tgt, data);
            }
        }

        GUI.enabled = true;
    }
Exemple #2
0
    public static void DrawAnimationMoveNodeInspector( AnimationMoveNode animNode , AnimationMoveData data )
    {
        data.targetName = EditorGUILayout.TextField( "Target Name" , data.targetName );
        data.duration = EditorGUILayout.Slider( "duration( ms )" , data.duration , 1f , 10000f );
        data.toX = EditorGUILayout.Slider( "toX" , data.toX , -500f , 500f );
        data.waitUntilAnimationFinish = EditorGUILayout.Toggle( "Wait next Until Finish" , data.waitUntilAnimationFinish );
        data.toggleFromAmount = EditorGUILayout.Toggle( "Start From?" , data.toggleFromAmount );
        //		data.method = EditorGUILayout.Popup( "Method" , data.method , AnimationNode.methods );
        if( data.toggleFromAmount ){
            data.fromX = EditorGUILayout.Slider( "fromX" , data.fromX , -500f , 500f );
        }

        GUI.enabled = Application.isPlaying;

        if( GUILayout.Button( "Preview" ) ){
         	GameObject tgt = GameObject.Find( data.targetName );
         	if( tgt != null ){
                AnimationMoveNode.Animate( animNode , tgt , data );
         	}
        }

        GUI.enabled = true;
    }