Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        BlendTree3D _target = (BlendTree3D)target;

        serializedObject.Update();

        if (GUILayout.Button("Add point"))
        {
            _target.AddPoint();
        }

        if (GUILayout.Button("Delete selected point"))
        {
            _target.DeleteSelectedPoint();
        }

        if (GUILayout.Button("Deselect all points"))
        {
            _target.DeselectAllPoints();
        }

        if (GUILayout.Button("Delete all points"))
        {
            _target.DeleteAllPoints();
        }

        if (GUILayout.Button("Create grid of points"))
        {
            _target.CreateGridOfPoints();
        }

        EditorGUILayout.Separator();
        EditorGUILayout.BeginVertical("HelpBox");
        EditorGUILayout.LabelField("Selected point");
        EditorGUILayout.Separator();

        foreach (BlendTree3DPoint point in _target.Points)
        {
            if (point.HighLight)
            {
                point.Position = EditorGUILayout.Vector3Field("Position", point.Position);

                point.Rotation = Vector4ToQuaternion(EditorGUILayout.Vector4Field("Rotation", QuaternionToVector4(point.Rotation)));
            }
        }

        EditorGUILayout.Separator();
        EditorGUILayout.Separator();
        EditorGUILayout.EndVertical();
        DrawDefaultInspector();
    }
Ejemplo n.º 2
0
 private void OnEnable()
 {
     _selected  = -1;
     _target    = (BlendTree3D)target;
     _transform = _target.transform;
 }