public override void OnPrimaryPress() { if (state.Value == 3) { Animator animator = rootSlot.Target.AttachComponent <Animator>(); animator.Clip.Target = _result.Target; foreach (TrackedRig rig in recordedRigs) { rig.OnReplace(animator); } foreach (TrackedSlot slot in recordedSlots) { slot.OnReplace(animator); } //foreach (ACMngr field in trackedFields) { field.OnStop(); } state.Value = 0; } else if (state.Value == 1) { state.Value = 2; StartTask(bakeAsync); } else if (state.Value == 0) { animation = new AnimX(1f); recordingUser.Target = LocalUser; state.Value = 1; _startTime.Value = base.Time.WorldTime; foreach (TrackedRig rig in recordedRigs) { rig.OnStart(this); } foreach (TrackedSlot slot in recordedSlots) { slot.OnStart(this); } //foreach (ACMngr field in trackedFields) { field.OnStart(this); } } }
public void OnStart(RecordingTool rt) { AnimX animx = rt.animation; Type type = source_field.Target.ValueType; if (type == typeof(float)) { floatTrack = animx.AddTrack <CurveFloatAnimationTrack>(); } if (type == typeof(float2)) { float2Track = animx.AddTrack <CurveFloat2AnimationTrack>(); } if (type == typeof(float2x2)) { float2x2Track = animx.AddTrack <CurveFloat2x2AnimationTrack>(); } if (type == typeof(float3)) { float3Track = animx.AddTrack <CurveFloat3AnimationTrack>(); } if (type == typeof(float3x3)) { float3x3Track = animx.AddTrack <CurveFloat3x3AnimationTrack>(); } if (type == typeof(float4)) { float4Track = animx.AddTrack <CurveFloat4AnimationTrack>(); } if (type == typeof(float4x4)) { float4x4Track = animx.AddTrack <CurveFloat4x4AnimationTrack>(); } if (type == typeof(int)) { intTrack = animx.AddTrack <CurveIntAnimationTrack>(); } if (type == typeof(int2)) { int2Track = animx.AddTrack <CurveInt2AnimationTrack>(); } if (type == typeof(int3)) { int3Track = animx.AddTrack <CurveInt3AnimationTrack>(); } if (type == typeof(int4)) { int4Track = animx.AddTrack <CurveInt4AnimationTrack>(); } if (type == typeof(bool)) { boolTrack = animx.AddTrack <CurveBoolAnimationTrack>(); } if (type == typeof(string)) { stringTrack = animx.AddTrack <CurveStringAnimationTrack>(); } if (type == typeof(char)) { charTrack = animx.AddTrack <CurveCharAnimationTrack>(); } if (type == typeof(color)) { colorTrack = animx.AddTrack <CurveColorAnimationTrack>(); } if (type == typeof(floatQ)) { floatQTrack = animx.AddTrack <CurveFloatQAnimationTrack>(); } if (type == typeof(long)) { longTrack = animx.AddTrack <CurveLongAnimationTrack>(); } if (type == typeof(ulong)) { ulongTrack = animx.AddTrack <CurveUlongAnimationTrack>(); } if (type == typeof(byte)) { byteTrack = animx.AddTrack <CurveByteAnimationTrack>(); } if (type == typeof(double)) { doubleTrack = animx.AddTrack <CurveDoubleAnimationTrack>(); } if (type == typeof(double2)) { double2Track = animx.AddTrack <CurveDouble2AnimationTrack>(); } if (type == typeof(double2x2)) { double2x2Track = animx.AddTrack <CurveDouble2x2AnimationTrack>(); } if (type == typeof(double3)) { double3Track = animx.AddTrack <CurveDouble3AnimationTrack>(); } if (type == typeof(double3x3)) { double3x3Track = animx.AddTrack <CurveDouble3x3AnimationTrack>(); } if (type == typeof(double4)) { double4Track = animx.AddTrack <CurveDouble4AnimationTrack>(); } if (type == typeof(double4x4)) { double4x4Track = animx.AddTrack <CurveDouble4x4AnimationTrack>(); } if (type == typeof(doubleQ)) { doubleQTrack = animx.AddTrack <CurveDoubleQAnimationTrack>(); } if (type == typeof(short)) { shortTrack = animx.AddTrack <CurveShortAnimationTrack>(); } if (type == typeof(ushort)) { ushortTrack = animx.AddTrack <CurveUshortAnimationTrack>(); } if (type == typeof(uint)) { uintTrack = animx.AddTrack <CurveUintAnimationTrack>(); } Slot s = holding_slot; FieldTracker fieldTracker = this; IField field = source_field.Target; if (type == typeof(float)) { fieldTracker.driven_field.Target = RecordedValueProcessor <float> .AttachComponents(s, (IField <float>) field); } if (type == typeof(float2)) { fieldTracker.driven_field.Target = RecordedValueProcessor <float2> .AttachComponents(s, (IField <float2>) field); } if (type == typeof(float2x2)) { fieldTracker.driven_field.Target = RecordedValueProcessor <float2x2> .AttachComponents(s, (IField <float2x2>) field); } if (type == typeof(float3)) { fieldTracker.driven_field.Target = RecordedValueProcessor <float3> .AttachComponents(s, (IField <float3>) field); } if (type == typeof(float3x3)) { fieldTracker.driven_field.Target = RecordedValueProcessor <float3x3> .AttachComponents(s, (IField <float3x3>) field); } if (type == typeof(float4)) { fieldTracker.driven_field.Target = RecordedValueProcessor <float4> .AttachComponents(s, (IField <float4>) field); } if (type == typeof(float4x4)) { fieldTracker.driven_field.Target = RecordedValueProcessor <float4x4> .AttachComponents(s, (IField <float4x4>) field); } if (type == typeof(int)) { fieldTracker.driven_field.Target = RecordedValueProcessor <int> .AttachComponents(s, (IField <int>) field); } if (type == typeof(int2)) { fieldTracker.driven_field.Target = RecordedValueProcessor <int2> .AttachComponents(s, (IField <int2>) field); } if (type == typeof(int3)) { fieldTracker.driven_field.Target = RecordedValueProcessor <int3> .AttachComponents(s, (IField <int3>) field); } if (type == typeof(int4)) { fieldTracker.driven_field.Target = RecordedValueProcessor <int4> .AttachComponents(s, (IField <int4>) field); } if (type == typeof(bool)) { fieldTracker.driven_field.Target = RecordedValueProcessor <bool> .AttachComponents(s, (IField <bool>) field); } if (type == typeof(string)) { fieldTracker.driven_field.Target = RecordedValueProcessor <string> .AttachComponents(s, (IField <string>) field); } if (type == typeof(char)) { fieldTracker.driven_field.Target = RecordedValueProcessor <char> .AttachComponents(s, (IField <char>) field); } if (type == typeof(color)) { fieldTracker.driven_field.Target = RecordedValueProcessor <color> .AttachComponents(s, (IField <color>) field); } if (type == typeof(floatQ)) { fieldTracker.driven_field.Target = RecordedValueProcessor <floatQ> .AttachComponents(s, (IField <floatQ>) field); } if (type == typeof(long)) { fieldTracker.driven_field.Target = RecordedValueProcessor <long> .AttachComponents(s, (IField <long>) field); } if (type == typeof(ulong)) { fieldTracker.driven_field.Target = RecordedValueProcessor <ulong> .AttachComponents(s, (IField <ulong>) field); } if (type == typeof(byte)) { fieldTracker.driven_field.Target = RecordedValueProcessor <byte> .AttachComponents(s, (IField <byte>) field); } if (type == typeof(double)) { fieldTracker.driven_field.Target = RecordedValueProcessor <double> .AttachComponents(s, (IField <double>) field); } if (type == typeof(double2)) { fieldTracker.driven_field.Target = RecordedValueProcessor <double2> .AttachComponents(s, (IField <double2>) field); } if (type == typeof(double2x2)) { fieldTracker.driven_field.Target = RecordedValueProcessor <double2x2> .AttachComponents(s, (IField <double2x2>) field); } if (type == typeof(double3)) { fieldTracker.driven_field.Target = RecordedValueProcessor <double3> .AttachComponents(s, (IField <double3>) field); } if (type == typeof(double3x3)) { fieldTracker.driven_field.Target = RecordedValueProcessor <double3x3> .AttachComponents(s, (IField <double3x3>) field); } if (type == typeof(double4)) { fieldTracker.driven_field.Target = RecordedValueProcessor <double4> .AttachComponents(s, (IField <double4>) field); } if (type == typeof(double4x4)) { fieldTracker.driven_field.Target = RecordedValueProcessor <double4x4> .AttachComponents(s, (IField <double4x4>) field); } if (type == typeof(doubleQ)) { fieldTracker.driven_field.Target = RecordedValueProcessor <doubleQ> .AttachComponents(s, (IField <doubleQ>) field); } if (type == typeof(short)) { fieldTracker.driven_field.Target = RecordedValueProcessor <short> .AttachComponents(s, (IField <short>) field); } if (type == typeof(ushort)) { fieldTracker.driven_field.Target = RecordedValueProcessor <ushort> .AttachComponents(s, (IField <ushort>) field); } if (type == typeof(uint)) { fieldTracker.driven_field.Target = RecordedValueProcessor <uint> .AttachComponents(s, (IField <uint>) field); } //source_field.Target = null; }