a˝5.0.0f4ţ˙˙˙s˙8-l'€Łć„hŒÎA,Œ€7€˙˙˙˙€Ś€˛€Ő€ ހ.€†€Ä€ ހ.€H€Ť€˙˙˙˙€1€1€˙˙˙˙ @ހ€ Q€j€ H€ę€˙˙˙˙ €1€1€˙˙˙˙ @ހ€Q€j€ń€(˙˙˙˙€1€1€˙˙˙˙€ހ€€j€˙˙˙˙€H€›€˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€y€ € ހ.€y€< ހ.€ހCH€T˙˙˙˙€1€1€˙˙˙˙ @ހ€!Q€j€"H€`˙˙˙˙#€1€1€˙˙˙˙$@ހ€%Q€j€&H€l˙˙˙˙'€1€1€˙˙˙˙(@ހ€)Q€j€*L€{+PPtrm_FileIDm_PathIDm_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespacem_AssemblyNamem_IsEditorScriptČ0ĹňĂôL.`?^Ů0D7€˙˙˙˙€Ś€˛€Ѐڀڀڀ#Ś€+H€3˙˙˙˙€1€1€˙˙˙˙@ހ€ Q€j€ ™€< Ś€H H€Z˙˙˙˙ €1€1€˙˙˙˙@ހ€Q€j€Ѐgڀڀڀ#Ś€+v~ € €– €Ÿ €¨ €ą €ş €Ă €Ě €Ő €Ţ  €ç! €ń" €ű# €$ €% €&Ő€#˙˙˙˙'€1€1€˙˙˙˙(€ހ€)H€j€˙˙˙˙*€1€1€˙˙˙˙+@ހ€,Q€j€-™€*.ހ8/AssetMetaDataguiddata[0]data[1]data[2]data[3]pathNametimeCreatedoriginalChangesetoriginalNameoriginalParentHash128originalDigestbytes[0]bytes[1]bytes[2]bytes[3]bytes[4]bytes[5]bytes[6]bytes[7]bytes[8]bytes[9]bytes[10]bytes[11]bytes[12]bytes[13]bytes[14]bytes[15]labelsassetStoreReflicenseType z{ď@îČă5^(H'7€˙˙˙˙€Ś€˛€ Ő€ ހ#.€,†€Ä€ ހ#.€,H€Ť€˙˙˙˙€1€1€˙˙˙˙ @ހ€ Q€j€ Ő€5˙˙˙˙ €1€1€˙˙˙˙ €ހ€€j€˙˙˙˙€H€›€˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€y€ € ހ#.€, €I@ž€X @ހ#.€,H€]˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€H€h˙˙˙˙€1€1€˙˙˙˙ @ހ€!Q€j€"H€z˙˙˙˙#€1€1€˙˙˙˙$@ހ€%Q€j€&MonoImporterPPtrm_FileIDm_PathIDm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariantˆ˙˙ˆ@  ˙˙ŕyŻČőss˙˙{˝ž ´)FŚ\!‰„ëDI/Assets/LeapMotion/Scripts/Utils/LeapRecorder.cs LeapRecorder‚/******************************************************************************\ * Copyright (C) Leap Motion, Inc. 2011-2014. * * Leap Motion proprietary. Licensed under Apache 2.0 * * Available at http://www.apache.org/licenses/LICENSE-2.0.html * \******************************************************************************/ using UnityEngine; using System; using System.IO; using System.Collections.Generic; using Leap; public enum RecorderState { Idling = 0, Recording = 1, Playing = 2 } public class LeapRecorder { public float speed = 1.0f; public bool loop = true; public RecorderState state = RecorderState.Playing; protected List frames_; protected float frame_index_; protected Frame current_frame_ = new Frame(); public LeapRecorder() { Reset(); } public void Stop() { state = RecorderState.Idling; frame_index_ = 0.0f; } public void Pause() { state = RecorderState.Idling; } public void Play() { state = RecorderState.Playing; } public void Record() { state = RecorderState.Recording; } public void Reset() { frames_ = new List(); frame_index_ = 0; } public void SetDefault() { speed = 1.0f; loop = true; } public float GetProgress() { return frame_index_ / frames_.Count; } public int GetIndex() { return (int)frame_index_; } public void SetIndex(int new_index) { if (new_index >= frames_.Count) { frame_index_ = frames_.Count - 1; } else { frame_index_ = new_index; } } public void AddFrame(Frame frame) { frames_.Add(frame.Serialize); } public Frame GetCurrentFrame() { return current_frame_; } public Frame NextFrame() { current_frame_ = new Frame(); if (frames_.Count > 0) { if (frame_index_ >= frames_.Count && loop) { frame_index_ -= frames_.Count; } else if (frame_index_ < 0 && loop) { frame_index_ += frames_.Count; } if (frame_index_ < frames_.Count && frame_index_ >= 0) { current_frame_.Deserialize(frames_[(int)frame_index_]); frame_index_ += speed; } } return current_frame_; } public List GetFrames() { List frames = new List(); for (int i = 0; i < frames_.Count; ++i) { Frame frame = new Frame(); frame.Deserialize(frames_[i]); frames.Add(frame); } return frames; } public int GetFramesCount() { return frames_.Count; } public string SaveToNewFile() { string path = Application.persistentDataPath + "/Recording_" + System.DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".bytes"; if (File.Exists(@path)) { File.Delete(@path); } FileStream stream = new FileStream(path, FileMode.Append, FileAccess.Write); for (int i = 0; i < frames_.Count; ++i) { byte[] frame_size = new byte[4]; frame_size = System.BitConverter.GetBytes(frames_[i].Length); stream.Write(frame_size, 0, frame_size.Length); stream.Write(frames_[i], 0, frames_[i].Length); } stream.Close(); return path; } public void Load(TextAsset text_asset) { byte[] data = text_asset.bytes; frame_index_ = 0; frames_.Clear(); int i = 0; while (i < data.Length) { byte[] frame_size = new byte[4]; Array.Copy(data, i, frame_size, 0, frame_size.Length); i += frame_size.Length; byte[] frame = new byte[System.BitConverter.ToUInt32(frame_size, 0)]; Array.Copy(data, i, frame, 0, frame.Length); i += frame.Length; frames_.Add(frame); } } } LeapRecorderAssembly-CSharp.dll