Example #1
0
    private void Update()
    {
        //probably not the best idea to record every update!
        if (isRecording)
        {
            Record();
        }
        if (isPlaying)
        {
            if (!transformDataConnectorsTimeDictionary.ContainsKey(idx))
            {
                return;
            }

            List <TransformData> data = transformDataConnectorsTimeDictionary[idx];
            foreach (TransformData td in data)
            {
                TransformDataConnector connector = new TransformDataConnector();
                connector.AddByName(td);
                connector.ApplyData();
            }

            if (idx == maxIdx)
            {
                isPlaying = false;
            }
            else
            {
                idx++;
            }
        }
    }
Example #2
0
 protected void Apply(List <TransformData> data)
 {
     foreach (TransformData t in data)
     {
         if (t != null)
         {
             TransformDataConnector connector = new TransformDataConnector();
             connector.AddByName(t);
             connector.ApplyData();
         }
     }
 }
Example #3
0
 private IEnumerator PlayScenario()
 {
     while (idx <= maxIdx)
     {
         if (transformDataConnectorsTimeDictionary.ContainsKey(idx))
         {
             List <TransformData> data = transformDataConnectorsTimeDictionary[idx];
             foreach (TransformData td in data)
             {
                 TransformDataConnector connector = new TransformDataConnector();
                 connector.AddByName(td);
                 connector.ApplyData();
             }
         }
         idx++;
         yield return(new WaitForSeconds(1f / speed));
     }
     isPlaying = false;
 }