Beispiel #1
0
    /// <summary>
    /// set action for the posAction Button = actionID
    /// </summary>
    /// <param name="possAction"></param>
    /// <param name="actionID"></param>
    void ChooseAction(int posAction, int actionID)
    {
        // set str_ActionChoose
        if (actionID != 0)
        {
            str_ActionChoose[posAction] = array_CogActionList[actionID];
        }
        else
        {
            str_ActionChoose[posAction] = "Choose Action";
        }


        // recheck enable, disable Actions
        for (int l = 1; l < 14; l++)
        {
            EmoCognitiv.EnableCognitivAction(EmoCognitiv.cognitivActionList[l], false);
        }

        for (int i = 1; i < 14; i++)
        {
            for (int j = 0; j < 3; j++)
            {
                if (str_ActionChoose[j] == array_CogActionList[i])
                {
                    EmoCognitiv.EnableCognitivAction(EmoCognitiv.cognitivActionList[i], true);
                }
            }
        }

        EmoCognitiv.EnableCognitivActionsList();
    }
 private void OnDeactiveClick(int ActionID)
 {
     EmoCognitiv.EnableCognitivAction(EmoCognitiv.cognitivActionList[ActionID], false);
     EmoCognitiv.EnableCognitivActionsList();
     Debug.Log("Deactive " + array_CogActionList[ActionID]);
     trainClearShow = false;
 }
    void OnGUI()
    {
        if (trainClearShow)
        {
            if (GUI.Button(new Rect(130 + 230, 20, 50, 20), "Train"))
            {
                OnTrainClick(curAction);
            }
            if (GUI.Button(new Rect(190 + 230, 20, 50, 20), "Clear"))
            {
                OnClearClick(curAction);
            }
        }
        if (GUI.Button(new Rect(250 + 230, 20, 80, 20), "Deactive"))
        {
            OnDeactiveClick(curAction);
        }

        vec2_Scroll = GUI.BeginScrollView(new Rect(120, 20, 225, 80), vec2_Scroll, new Rect(0, 0, 100, 280));

        for (int i = 0; i < 14; i++)
        {
            if (GUI.Button(new Rect(0, i * 20, 210, 20), array_CogActionList[i]))
            {
                curAction = i;
                EmoCognitiv.EnableCognitivAction(EmoCognitiv.cognitivActionList[i], true);
                EmoCognitiv.EnableCognitivActionsList();
                trainClearShow = true;
            }
        }

        GUI.EndScrollView();
    }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     //enable cognitiv action
     EmoCognitiv.EnableCognitivAction(EdkDll.EE_CognitivAction_t.COG_LIFT, true);
     EmoCognitiv.EnableCognitivAction(EdkDll.EE_CognitivAction_t.COG_PUSH, true);
     EmoCognitiv.EnableCognitivAction(EdkDll.EE_CognitivAction_t.COG_PULL, true);
     EmoCognitiv.EnableCognitivActionsList();
 }