Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        float time = Time.realtimeSinceStartup - timeFromStart;

        if (isRecording)
        {
            MyTransform t = new MyTransform();
            t.SetData(Recorder.transform, time);
            myTransforms.Add(t);
            counter++;
        }
        else if (isPlaying)
        {
            //最後まで再生したらループする
            if (counter >= myTransforms.Count)
            {
                StartPlay();
            }
            else
            {
                var playTransform = myTransforms[counter];

                if (time > playTransform.Time)
                {
                    Player.transform.position   = playTransform.Pos;
                    Player.transform.rotation   = playTransform.Rot;
                    Player.transform.localScale = playTransform.Scale;
                    counter++;
                }
            }
        }
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
#if UNITY_WSA
        RegistResolver();
#endif
        //初期位置を記録する
        startTrans = new MyTransform();
        startTrans.SetData(Recorder.transform, 0);

        myTransforms = new List <MyTransform>();


#if ENABLE_DOTNET
        Debug.Log(".net");
#endif

#if ENABLE_IL2CPP
        Debug.Log("IL2CPP");
#endif

#if WINDOWS_UWP
        // UWP上での動作の場合、LocalAppData/AppName/LocalStateフォルダを参照する
        saveFileName = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, saveFileName);
#else
        // Unity上での動作の場合、Assets/StreamingAssetsフォルダを参照する
        saveFileName = System.IO.Path.Combine(UnityEngine.Application.streamingAssetsPath, saveFileName);
#endif

        //   TestObjList();
    }