コード例 #1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        ToggleController myScript = (ToggleController)target;

        if (GUILayout.Button("Get Origin position"))
        {
            myScript.GetCurrentTextPosition(0);
        }

        if (GUILayout.Button("Get Final position"))
        {
            myScript.GetCurrentTextPosition(1);
        }

        GUILayout.Space(10);

        if (GUILayout.Button("Set to Origin position"))
        {
            myScript.SetToTextPosition(0);
        }

        if (GUILayout.Button("Set to Final position"))
        {
            myScript.SetToTextPosition(1);
        }
    }