Example #1
0
        void OnEnable()
        {
            if (UseGlobalPath)
            {
                dataPath    = VRsqrGlobalSettings.DataPrePath;
                subjectsStr = VRsqrGlobalSettings.SubjectsStr;
            }
            string fullSubjectsPath = dataPath + @"\" + subjectsStr;

            fullFileName = fullSubjectsPath + @"\" + eventName + ".txt"; // "_" + DateTime.Now.ToString("s") + ".txt";
            Directory.CreateDirectory(fullSubjectsPath);

            VRsqr_EventsManager.StartListening(eventName, dataEventHandler);

            dataLines = new List <List <string> >();

            VRsqr_InputKeyboard.AddKeyListener(KeyCode.S, toggleRecording, null, "Toggle recording");

            int timeMs = DateTime.Now.Hour * 60 * 60 * 1000 + DateTime.Now.Minute * 60 * 1000 + DateTime.Now.Second * 1000 + DateTime.Now.Millisecond; //(float)ts.TotalMilliseconds;

            initTimeHeader = "Start time: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture) + "\t" + timeMs;

            DataFieldNames.Add("[EventName]");
            numFields++;
            DataFieldNames.Add("[TimeStampOUT]");
            numFields++;
            DataFieldNames.Add("[TimeStampIN]");
            numFields++;
        }
 private void Awake()
 {
     if (EventNameConnect.From != "")
     {
         VRsqr_EventsManager.StartListening(EventNameConnect.From, eventHandler);
         VRsqrUtil.Debug.Log(LogLevel.Debug, "VRsqr_EventsConnector:Awake - StartListening - EventNameConnect.From = " + EventNameConnect.From);
     }
 }
Example #3
0
 public static void AddKeyEventListener(KeyCode keyCode, string keyDownEventName, UnityAction <int> keyDownlistener, string keyUpEventName = null, UnityAction <int> keyUplistener = null, string keyHelpText = null)
 {
     AddKeyEvent(keyCode, keyDownEventName, keyUpEventName, keyHelpText);
     VRsqr_EventsManager.StartListening(keyDownEventName, keyDownlistener);
     if (keyUpEventName != null && keyUplistener != null)
     {
         VRsqr_EventsManager.StartListening(keyUpEventName, keyUplistener);
     }
 }
Example #4
0
 // Use this for initialization
 private void OnEnable()
 {
     if (eventSequence.Length > 0)
     {
         if (eventSequence.Length > 0 &&
             !string.IsNullOrEmpty(eventSequence[0].TriggerEventIn) &&
             eventSequence[0].EnableStep)
         {
             VRsqr_EventsManager.StartListening(VRsqr_EventsManager.StandardizeString(eventSequence[eventInd].TriggerEventIn), NextEventHandler);
         }
     }
 }
Example #5
0
    // Use this for initialization
    void Awake()
    {
        foreach (Transform child in transform)
        {
            child.gameObject.SetActive(false); // !child.gameObject.activeSelf);
        }
        VRsqr_EventsManager.StartListening(endEventIn, EndFunction);

        if (startEventIn != "")
        {
            VRsqr_EventsManager.StartListening(startEventIn, InitFunction);
        }
        else
        {
            Init();
        }
    }
Example #6
0
    void NextEvent()
    {
        // trigger the sequence of events, until the sequence requires waiting for an event to continue triggering it
        while (eventSequence.Length > eventInd)
        {
            if (eventSequence[eventInd].EnableStep)
            {
                eventSequence[eventInd].eventOut.trigger();
            }

            eventInd++;

            // Next event in sequence is pending an event to trigger it
            if (eventSequence.Length > eventInd &&
                !string.IsNullOrEmpty(eventSequence[eventInd].TriggerEventIn) &&
                eventSequence[eventInd].EnableStep)
            {
                VRsqr_EventsManager.StartListening(VRsqr_EventsManager.StandardizeString(eventSequence[eventInd].TriggerEventIn), NextEventHandler);
                break;
            }
        }
    }
Example #7
0
 // Use this for initialization
 void OnEnable()
 {
     VRsqr_EventsManager.StartListening(someEvent_In, eventHandler_In);
 }