Exemplo n.º 1
0
    public void OnEnable()
    {
        mySettingAction = (SettingAction)target;
        activeIndex     = serializedObject.FindProperty("activeIndex");
        methodName      = serializedObject.FindProperty("methodName");
        time            = serializedObject.FindProperty("time");
        animations      = serializedObject.FindProperty("animations");
        //sendInt = serializedObject.FindProperty("sendInt");
        //sendFloat = serializedObject.FindProperty("sendFloat");
        //sendBool = serializedObject.FindProperty("sendBool");
        //sendObject = serializedObject.FindProperty("sendObject");
        sendParameterType = serializedObject.FindProperty("sendParameterType");
        preview           = serializedObject.FindProperty("preview");

        if (mySettingAction.eventSet.Count < 1)
        {
            mySettingAction.eventSet.Add(new SettingAction.EventSet());
            activeIndex.intValue = 0;
        }

        sizeInt    = new int[mySettingAction.eventSet.Count];
        stringSize = new string[mySettingAction.eventSet.Count];
        for (int i = 0; i < sizeInt.Length; i++)
        {
            sizeInt[i]    = i;
            stringSize[i] = (i).ToString();
        }
    }
Exemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        try{
            mySettingAction = (SettingAction)target;
            if (GUILayout.Button("Create Action"))
            {
                mySettingAction.eventSet.Add(new SettingAction.EventSet());
                SetSizeIntPopUp();
            }

            preview.boolValue = GUILayout.Toggle(preview.boolValue, "Preview Animation");

            activeIndex.intValue = EditorGUILayout.IntPopup("Active Index", activeIndex.intValue, stringSize, sizeInt);
            if (currenctActiveIndex != activeIndex.intValue)
            {
                ResetDisplayValue();
                GetDisplayValue();
            }
            else
            {
                SetDisplayValue();
            }

            if (GUILayout.Button("Apply"))
            {
                Debug.Log("Apply Setting");
                ResetDisplayValue();
                GetDisplayValue();
            }

            if (GUILayout.Button("Delete Action"))
            {
                if (mySettingAction.eventSet.Count > 1)
                {
                    mySettingAction.eventSet.RemoveRange(activeIndex.intValue, 1);
                    SetSizeIntPopUp();
                    activeIndex.intValue -= 1;
                    if (activeIndex.intValue <= 0)
                    {
                        activeIndex.intValue = 0;
                    }
                }
                serializedObject.Update();
                serializedObject.ApplyModifiedProperties();
            }

            currenctActiveIndex = activeIndex.intValue;
        }catch {
            Debug.Log("Catch");
        }
        serializedObject.ApplyModifiedProperties();
    }
Exemplo n.º 3
0
 public OptionSettingData ToChangeSettingData(SettingAction action) => new OptionSettingData(action, this);
Exemplo n.º 4
0
 public IHttpActionResult GetSetting([FromUri] SettingAction action)
 {
     action = new SettingAction();
     return(MakeResult(action.Execute(this.CurrentObjectContext)));
 }
Exemplo n.º 5
0
 public SettingData(SettingAction action) => Action = action;
Exemplo n.º 6
0
 public OptionSettingData(SettingAction action, OptionSetting settings) : base(action) => Setting = settings;