public override void OnInspectorGUI() { DrawDefaultInspector(); FacialExpressions fScript = (FacialExpressions)target; expressionName = GUILayout.TextField(expressionName); if (GUILayout.Button("Setup")) { fScript.CountBlendShapes(); } else if (GUILayout.Button("Create expression")) { Undo.RecordObject(fScript, "Create expression " + expressionName); fScript.CreateExpression(expressionName); } else if (GUILayout.Button("Set to named expression")) { Undo.RecordObject(fScript, "Set to expression " + expressionName); fScript.SetExpressionImmediate(expressionName); } else if (GUILayout.Button("Reset")) { Undo.RecordObject(fScript, "Reset expression " + expressionName); fScript.ResetShapes(); } }
private void OnEnable() { FacialExpressions fScript = (FacialExpressions)target; fScript.CountBlendShapes(); }