/// <summary>
        /// 録画開始
        /// </summary>
        public void RecordStart()
        {
            if (_recording == false)
            {
                _frameIndex   = 0;
                _recordedTime = 0;
                _poses        = ScriptableObject.CreateInstance <HumanoidPoses>();

                _onRecordEnd += WriteAnimationFile;
                _recording    = true;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 録画開始
        /// </summary>
        private void RecordStart()
        {
            if (_recording)
            {
                return;
            }


            Poses        = ScriptableObject.CreateInstance <HumanoidPoses>();
            RecordedTime = 0f;

            _onRecordEnd += WriteAnimationFile;
            FrameIndex    = 0;
            _recording    = true;
        }
        //CSVから_recordedMotionDataを作る
        public void LoadCSVData(string motionDataPath)
        {
            //ファイルが存在しなければ終了
            if (!File.Exists(motionDataPath))
            {
                return;
            }

            _recordedMotionData = new HumanoidPoses();

            FileStream   fs = null;
            StreamReader sr = null;

            //ファイル読み込み
            try
            {
                fs = new FileStream(motionDataPath, FileMode.Open);
                sr = new StreamReader(fs);
                string[] tickString = sr.ReadLine().Split(',');

                while (sr.Peek() > -1)
                {
                    string line = sr.ReadLine();
                    HumanoidPoses.SerializeHumanoidPose seriHumanPose = new HumanoidPoses.SerializeHumanoidPose();
                    if (line != "")
                    {
                        seriHumanPose.DeserializeCSV(line);
                        _recordedMotionData.Poses.Add(seriHumanPose);
                    }
                }
                sr.Close();
                fs.Close();
                sr = null;
                fs = null;
            }
            catch (System.Exception e)
            {
                Debug.LogError("ファイル読み込み失敗!" + e.Message + e.StackTrace);
            }
            if (sr != null)
            {
                sr.Close();
            }
            if (fs != null)
            {
                fs.Close();
            }
        }
        /// <summary>
        /// 録画開始
        /// </summary>
        private void RecordStart()
        {
            if (_recording)
            {
                return;
            }

            Poses            = ScriptableObject.CreateInstance <HumanoidPoses>();
            RecordedTime     = 0f;
            _recordStartTime = Time.realtimeSinceStartup;
            if (OnRecordStart != null)
            {
                OnRecordStart();
            }

            FrameIndex = 0;
            _recording = true;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 録画開始
        /// </summary>
        private void RecordStart()
        {
            if (_recording)
            {
                return;
            }


            Poses = ScriptableObject.CreateInstance <HumanoidPoses>();

            if (OnRecordStart != null)
            {
                OnRecordStart();
            }

            OnRecordEnd += WriteAnimationFile;
            _recording   = true;
            RecordedTime = 0f;
            StartTime    = Time.time;
            FrameIndex   = 0;
        }