コード例 #1
0
        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();
            }
        }
コード例 #2
0
        private void OnEnable()
        {
            FacialExpressions fScript = (FacialExpressions)target;

            fScript.CountBlendShapes();
        }