Ghost frames fix plus undo redo system

This commit is contained in:
AbstractConcept 2022-09-18 19:07:44 -05:00
parent 591b176924
commit b0a965e0b2
163 changed files with 948 additions and 214 deletions

View File

@ -815,7 +815,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 935483303198879684}
m_RootOrder: 6
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -983,10 +983,10 @@ RectTransform:
- {fileID: 935483304734640508}
- {fileID: 935483304451841478}
- {fileID: 935483303811839839}
- {fileID: 935483304407649878}
- {fileID: 935483304187088279}
- {fileID: 935483302976181084}
- {fileID: 935483304407649878}
- {fileID: 935483303286354285}
- {fileID: 935483304187088279}
- {fileID: 935483303347104685}
- {fileID: 4300837137852148242}
- {fileID: 6085830301941788007}
@ -1190,7 +1190,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 935483303198879684}
m_RootOrder: 7
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -2251,7 +2251,7 @@ RectTransform:
m_Children:
- {fileID: 935483302769328936}
m_Father: {fileID: 935483303198879684}
m_RootOrder: 5
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -2740,7 +2740,7 @@ RectTransform:
m_Children:
- {fileID: 935483304355133267}
m_Father: {fileID: 935483303198879684}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}

View File

@ -32,7 +32,7 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
@ -52,7 +52,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &3922218029245345
RectTransform:
m_ObjectHideFlags: 0
@ -71,7 +71,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -16, y: 20}
m_SizeDelta: {x: 0, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &3581489635090573721
MonoBehaviour:
@ -116,10 +116,10 @@ MonoBehaviour:
m_FillRect: {fileID: 0}
m_HandleRect: {fileID: 4629009613275671144}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 0
m_MinValue: 1
m_MaxValue: 100
m_WholeNumbers: 1
m_Value: 1
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
@ -181,8 +181,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 1, b: 0.9510727, a: 0.5019608}
m_RaycastTarget: 1
m_Color: {r: 0.2, g: 0.2, b: 0.2, a: 0.5019608}
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:

View File

@ -322,7 +322,7 @@ RectTransform:
- {fileID: 1302075273}
- {fileID: 1849536740}
m_Father: {fileID: 1335076903}
m_RootOrder: 22
m_RootOrder: 24
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -471,7 +471,18 @@ MonoBehaviour:
m_CharacterLimit: 0
m_OnEndEdit:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 1323324190}
m_MethodName: OnCycleNormalFieldChange
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
@ -637,6 +648,76 @@ PrefabInstance:
propertyPath: m_Name
value: ActorCard
objectReference: {fileID: 0}
- target: {fileID: 935483303347104684, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 935483303347104684, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 935483303347104684, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 457137179}
- target: {fileID: 935483303347104684, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 935483303347104684, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: UpdateAnimationDef
objectReference: {fileID: 0}
- target: {fileID: 935483303347104684, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 935483303811839838, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OnBodyTypeChanged
objectReference: {fileID: 0}
- target: {fileID: 935483304734640511, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: m_Value
value: 1
objectReference: {fileID: 0}
- target: {fileID: 935483304734640511, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 935483304734640511, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 935483304734640511, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 457137179}
- target: {fileID: 935483304734640511, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 935483304734640511, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: UpdateAnimationDef
objectReference: {fileID: 0}
- target: {fileID: 935483304734640511, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 73a40f7e8cdb25c4390e3ea857ff50ea, type: 3}
--- !u!1 &77649835
@ -1078,7 +1159,7 @@ GameObject:
- component: {fileID: 138865806}
- component: {fileID: 138865805}
m_Layer: 5
m_Name: Background
m_Name: SliderBackground
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -1506,7 +1587,7 @@ RectTransform:
- {fileID: 591894605}
- {fileID: 138865804}
m_Father: {fileID: 1335076903}
m_RootOrder: 17
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
@ -2816,7 +2897,7 @@ Transform:
- {fileID: 143158141}
- {fileID: 284483059}
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &395375411
GameObject:
@ -3331,7 +3412,7 @@ RectTransform:
- {fileID: 749354207}
- {fileID: 1153227823}
m_Father: {fileID: 1335076903}
m_RootOrder: 19
m_RootOrder: 21
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -3381,7 +3462,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
@ -3405,6 +3486,18 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 433613847}
m_CullTransparentMesh: 0
--- !u!114 &457137179 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3804747680697097237, guid: 73a40f7e8cdb25c4390e3ea857ff50ea,
type: 3}
m_PrefabInstance: {fileID: 75718000}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9731614c7527b624492dd33f9b006fcb, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &502634720
GameObject:
m_ObjectHideFlags: 0
@ -3714,7 +3807,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &519420033
MonoBehaviour:
@ -5109,7 +5202,7 @@ RectTransform:
- {fileID: 1960844026}
- {fileID: 1463915053}
m_Father: {fileID: 1335076903}
m_RootOrder: 16
m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -5231,7 +5324,7 @@ RectTransform:
- {fileID: 783530509}
- {fileID: 725162531}
m_Father: {fileID: 1335076903}
m_RootOrder: 18
m_RootOrder: 20
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -5634,7 +5727,7 @@ RectTransform:
- {fileID: 371198550}
- {fileID: 77649836}
m_Father: {fileID: 1335076903}
m_RootOrder: 24
m_RootOrder: 26
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -6641,6 +6734,84 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: -20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &859476423
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 859476424}
- component: {fileID: 859476426}
- component: {fileID: 859476425}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &859476424
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 859476423}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1345808904}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &859476425
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 859476423}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Redo
--- !u!222 &859476426
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 859476423}
m_CullTransparentMesh: 0
--- !u!1 &891070577
GameObject:
m_ObjectHideFlags: 0
@ -7428,7 +7599,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &932977621
GameObject:
@ -8346,7 +8517,7 @@ RectTransform:
- {fileID: 347034222}
- {fileID: 932977622}
m_Father: {fileID: 1335076903}
m_RootOrder: 25
m_RootOrder: 27
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -8439,7 +8610,7 @@ RectTransform:
- {fileID: 1898380637}
- {fileID: 1966925531}
m_Father: {fileID: 1335076903}
m_RootOrder: 27
m_RootOrder: 29
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -9904,7 +10075,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1335076899
GameObject:
@ -10012,6 +10183,8 @@ RectTransform:
- {fileID: 899286715}
- {fileID: 1136677497}
- {fileID: 149343615}
- {fileID: 2134497164}
- {fileID: 1345808904}
- {fileID: 592091831}
- {fileID: 219230438}
- {fileID: 629081414}
@ -10025,7 +10198,7 @@ RectTransform:
- {fileID: 1914421494}
- {fileID: 1121706670}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -10162,6 +10335,136 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1344070787}
m_CullTransparentMesh: 0
--- !u!1 &1345808903
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1345808904}
- component: {fileID: 1345808907}
- component: {fileID: 1345808906}
- component: {fileID: 1345808905}
m_Layer: 5
m_Name: RedoButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1345808904
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1345808903}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 859476424}
m_Father: {fileID: 1335076903}
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 98, y: 285}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1345808905
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1345808903}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1345808906}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2086782053}
m_MethodName: Redo
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1345808906
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1345808903}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1345808907
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1345808903}
m_CullTransparentMesh: 0
--- !u!1 &1354159499
GameObject:
m_ObjectHideFlags: 0
@ -11546,7 +11849,18 @@ MonoBehaviour:
m_CharacterLimit: 0
m_OnEndEdit:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 1323324190}
m_MethodName: OnCycleFastFieldChange
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
@ -11872,6 +12186,84 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1481521046}
m_CullTransparentMesh: 0
--- !u!1 &1484247518
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1484247519}
- component: {fileID: 1484247521}
- component: {fileID: 1484247520}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1484247519
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1484247518}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2134497164}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1484247520
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1484247518}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Undo
--- !u!222 &1484247521
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1484247518}
m_CullTransparentMesh: 0
--- !u!1 &1486546820
GameObject:
m_ObjectHideFlags: 0
@ -13449,7 +13841,7 @@ RectTransform:
- {fileID: 1395818346}
- {fileID: 1798757604}
m_Father: {fileID: 1335076903}
m_RootOrder: 21
m_RootOrder: 23
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -13545,7 +13937,7 @@ RectTransform:
- {fileID: 1092312354}
- {fileID: 891468915}
m_Father: {fileID: 1335076903}
m_RootOrder: 20
m_RootOrder: 22
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -15526,7 +15918,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1895236501
GameObject:
@ -15804,7 +16196,7 @@ RectTransform:
- {fileID: 1543793723}
- {fileID: 1344070788}
m_Father: {fileID: 1335076903}
m_RootOrder: 26
m_RootOrder: 28
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -16105,7 +16497,7 @@ RectTransform:
- {fileID: 1481521047}
- {fileID: 1261535758}
m_Father: {fileID: 1335076903}
m_RootOrder: 23
m_RootOrder: 25
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -16497,6 +16889,52 @@ MonoBehaviour:
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
--- !u!1 &2086782052
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2086782054}
- component: {fileID: 2086782053}
m_Layer: 0
m_Name: Workspace
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2086782053
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2086782052}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bf0f782b7c407bf4896b633d509f5568, type: 3}
m_Name:
m_EditorClassIdentifier:
workspaceHistory: []
historyIndex: -1
maxHistoryDepth: 100
--- !u!4 &2086782054
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2086782052}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 699.4843, y: 244.28134, z: -283}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2093466856
GameObject:
m_ObjectHideFlags: 0
@ -16849,3 +17287,133 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2124969760}
m_CullTransparentMesh: 0
--- !u!1 &2134497163
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2134497164}
- component: {fileID: 2134497167}
- component: {fileID: 2134497166}
- component: {fileID: 2134497165}
m_Layer: 5
m_Name: UndoButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2134497164
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2134497163}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1484247519}
m_Father: {fileID: 1335076903}
m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -62, y: 285.5}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2134497165
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2134497163}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 2134497166}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2086782053}
m_MethodName: Undo
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &2134497166
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2134497163}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &2134497167
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2134497163}
m_CullTransparentMesh: 0

View File

@ -9,8 +9,10 @@ namespace RimWorldAnimationStudio
public string layer = "Pawn";
public List<string> tags;
[XmlIgnore] public int duration;
[XmlIgnore] public Dictionary<int, string> SoundEffects = new Dictionary<int, string>();
//[XmlIgnore] public Dictionary<int, string> SoundEffects = new Dictionary<int, string>();
//[XmlIgnore] public int duration;
public virtual int duration { get { return 0; } }
public abstract void BuildSimpleCurves();

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;
using UnityEngine;
@ -20,6 +21,8 @@ namespace RimWorldAnimationStudio
[XmlIgnore] public SimpleCurve HeadFacing = new SimpleCurve();
[XmlIgnore] public SimpleCurve BodyFacing = new SimpleCurve();
public override int duration { get { return keyframes.Max(x => x.atTick.Value); } }
public override void BuildSimpleCurves()
{
BodyAngle.Clear();
@ -36,7 +39,6 @@ namespace RimWorldAnimationStudio
foreach (PawnKeyframe frame in keyframes)
{ duration += frame.tickDuration; }
this.duration = duration;
int keyframePosition = 0;
for (int i = 0; i < keyframes.Count; i++)

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;
@ -13,9 +14,12 @@ namespace RimWorldAnimationStudio
[XmlIgnore] public SimpleCurve PositionZ = new SimpleCurve();
[XmlIgnore] public SimpleCurve Rotation = new SimpleCurve();
public override int duration { get { return keyframes.Max(x => x.atTick.Value); } }
public override void BuildSimpleCurves()
{
int duration = 0;
//getting the length of the whole clip
foreach (ThingKeyframe frame in keyframes)
{
@ -23,7 +27,7 @@ namespace RimWorldAnimationStudio
}
//guarantees loops don't get cut off mid-anim
this.duration = duration;
//this.duration = duration;
int keyframePosition = 0;
foreach (ThingKeyframe frame in keyframes)
@ -33,9 +37,6 @@ namespace RimWorldAnimationStudio
PositionX.Add((float)frame.atTick / (float)duration, frame.positionX, true);
PositionZ.Add((float)frame.atTick / (float)duration, frame.positionZ, true);
Rotation.Add((float)frame.atTick / (float)duration, frame.rotation, true);
if (frame.soundEffect != null)
{ SoundEffects.Add((int)frame.atTick, frame.soundEffect); }
}
else
@ -44,9 +45,6 @@ namespace RimWorldAnimationStudio
PositionZ.Add((float)keyframePosition / (float)duration, frame.positionZ, true);
Rotation.Add((float)keyframePosition / (float)duration, frame.rotation, true);
if (frame.soundEffect != null)
{ SoundEffects.Add(keyframePosition, frame.soundEffect); }
keyframePosition += frame.tickDuration;
}
}

View File

@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;
using UnityEngine;
namespace RimWorldAnimationStudio
{
@ -27,5 +29,53 @@ namespace RimWorldAnimationStudio
animationTimeTicks += stage.playTimeTicks;
}
}
public void RunPreSaveOperations()
{
// Stage edits
for (int i = 0; i < animationStages.Count; i++)
{
AnimationStage stage = animationStages[i];
// Sort keyframes by atTick
foreach (PawnAnimationClip clip in stage.animationClips)
{ clip.keyframes = clip.keyframes.OrderBy(x => x.atTick).ToList(); }
// Check if looping
int stageWindowSize = animationStages[i].stageWindowSize > 0 ? animationStages[i].stageWindowSize : animationStages[i].animationClips.Select(x => x.duration).Max();
int cycles = Mathf.CeilToInt(animationStages[i].playTimeTicks / stageWindowSize);
Debug.Log(animationStages[i].playTimeTicks);
Debug.Log(animationStages[i].stageWindowSize);
Debug.Log(cycles);
stage.isLooping = cycles > 1;
}
// Body part list edit
foreach (Actor actor in actors)
{
actor.isFucking = actor.requiredGenitals.Contains("Any appendage");
if (actor.isFucking == true)
{ actor.requiredGenitals.Remove("Any appendage"); }
actor.isFucked= actor.requiredGenitals.Contains("Any orifice");
if (actor.isFucked == true)
{ actor.requiredGenitals.Remove("Any orifice"); }
}
}
public void RunPostLoadOperations()
{
foreach (Actor actor in actors)
{
if (actor.isFucking == true)
{ actor.requiredGenitals.Add("Any appendage"); }
if (actor.isFucked == true)
{ actor.requiredGenitals.Add("Any orifice"); }
}
}
}
}

View File

@ -18,7 +18,7 @@ namespace RimWorldAnimationStudio
public void Initialize()
{
foreach (AnimationClip clip in animationClips)
foreach (PawnAnimationClip clip in animationClips)
{
clip.BuildSimpleCurves();

View File

@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
@ -13,6 +14,9 @@ namespace RimWorldAnimationStudio
public InputField bodyOffsetZField;
public Toggle initiatorToggle;
private int actorID = -1;
private bool isDirty = false;
public void Initialize()
{
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
@ -24,15 +28,30 @@ namespace RimWorldAnimationStudio
bodyOffsetZField.text = actor.bodyTypeOffset.GetOffset(bodyType).z.ToString();
}
public void UpdateAnimationDef()
public void OnBodyTypeChanged()
{
if (Workspace.animationDef == null) return;
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
string bodyType = bodyTypeDropdown.options[bodyTypeDropdown.value].text;
bodyType = bodyType == null || bodyType == "" ? "Male" : bodyType;
Debug.Log(bodyType);
AnimationController.Instance.transform.GetChild(Workspace.actorID).GetComponent<ActorBody>().bodyType = bodyType;
AnimationController.Instance.GetComponentsInChildren<ActorBody>()[Workspace.actorID].bodyType = bodyType;
bodyOffsetXField.text = actor.bodyTypeOffset.GetOffset(bodyType).x.ToString();
bodyOffsetZField.text = actor.bodyTypeOffset.GetOffset(bodyType).z.ToString();
}
public void UpdateAnimationDef()
{
if (Workspace.animationDef == null || isDirty) return;
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
string bodyType = bodyTypeDropdown.options[bodyTypeDropdown.value].text;
bodyType = bodyType == null || bodyType == "" ? "Male" : bodyType;
float.TryParse(bodyOffsetXField.text, out float x);
float.TryParse(bodyOffsetZField.text, out float z);
actor.bodyTypeOffset.SetOffset(bodyType, new Vector2(x, z));
@ -42,6 +61,8 @@ namespace RimWorldAnimationStudio
public void OpenSelectBodyPartsDialog()
{
if (Workspace.animationDef == null) return;
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
var dialog = Resources.FindObjectsOfTypeAll(typeof(SelectBodyPartsDialog)) as SelectBodyPartsDialog[];
@ -51,6 +72,8 @@ namespace RimWorldAnimationStudio
public void OpenSelectDefNamesDialog()
{
if (Workspace.animationDef == null) return;
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
var dialog = Resources.FindObjectsOfTypeAll(typeof(SelectDefNamesDialog)) as SelectDefNamesDialog[];
@ -60,11 +83,42 @@ namespace RimWorldAnimationStudio
public void OpenSelectBodyDefTypesDialog()
{
if (Workspace.animationDef == null) return;
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
var dialog = Resources.FindObjectsOfTypeAll(typeof(SelectBodyDefTypesDialog)) as SelectBodyDefTypesDialog[];
if (dialog != null)
{ dialog[0].Initialize(actor); dialog[0].Pop(); }
}
public void Update()
{
if (Workspace.animationDef == null) return;
if (actorID != Workspace.actorID)
{
isDirty = true;
if (Workspace.actorID >= AnimationController.Instance.GetComponentsInChildren<ActorBody>().Count())
{ Debug.Log("Waiting for actors to initialize..."); return; }
Actor actor = Workspace.animationDef.actors[Workspace.actorID];
ActorBody actorBody = AnimationController.Instance.GetComponentsInChildren<ActorBody>()[Workspace.actorID];
string bodyType = actorBody.bodyType;
bodyType = bodyType == null || bodyType == "" ? "Male" : bodyType;
bodyTypeDropdown.value = bodyTypeDropdown.options.IndexOf(bodyTypeDropdown.options.First(x => x.text == bodyType));
bodyOffsetXField.text = actor.bodyTypeOffset.GetOffset(bodyType).x.ToString();
bodyOffsetZField.text = actor.bodyTypeOffset.GetOffset(bodyType).z.ToString();
initiatorToggle.isOn = actor.initiator;
actorID = Workspace.actorID;
isDirty = false;
}
}
}
}

View File

@ -63,5 +63,10 @@ namespace RimWorldAnimationStudio
else
{ GetComponent<Image>().color = Constants.ColorGrey; }
}
public void InitiateUpdateOfGhostFrames()
{
BroadcastMessage("UpdateGhostFrames");
}
}
}

View File

@ -41,7 +41,7 @@ namespace RimWorldAnimationStudio
Transform contentWindow = transform.FindDeepChild("Content");
Reset();
for (int i = 0; i < Workspace.bodyParts.Count; i++)
for (int i = 0; i < Workspace.interactionDefTypes.Count; i++)
{
string interactionDefType = Workspace.interactionDefTypes[i];

View File

@ -43,12 +43,11 @@ namespace RimWorldAnimationStudio
public void OnValueChanged()
{
keyframe.atTick = (int)value;
UpdateGhostFrames();
clip.BuildSimpleCurves();
AnimationController.Instance.stageTick = keyframe.atTick.Value;
timeline.InitiateUpdateOfGhostFrames();
}
// Ghost sliders are non-interactable slider handle
@ -57,27 +56,25 @@ namespace RimWorldAnimationStudio
if (maxGhosts == 0)
{ return; }
int nGhosts = GetGhostFramesRequired();
int requiredGhosts = GetGhostFramesRequired();
int currentGhostCount = ghostSliders.childCount;
for (int i = 0; i < Mathf.Max(nGhosts, ghostSliders.childCount); i++)
for (int i = 0; i < Mathf.Max(requiredGhosts, currentGhostCount); i++)
{
if ((i - 1) * clip.duration + keyframe.atTick <= Workspace.StageWindowSize)
{
if (ghostSliders.childCount <= i)
{ Instantiate(ghostSliderPrefab, ghostSliders); }
int targetTick = (int)(i * clip.duration + keyframe.atTick);
GameObject ghostSliderObject = ghostSliders.GetChild(i).gameObject;
ghostSliderObject.SetActive(true);
if (ghostSliders.childCount <= i)
{ Instantiate(ghostSliderPrefab, ghostSliders); }
Slider ghostSlider = ghostSliderObject.GetComponent<Slider>();
ghostSlider.value = (int)((i + 1) * clip.duration + keyframe.atTick);
GameObject ghostSliderObject = ghostSliders.GetChild(i).gameObject;
ghostSliderObject.SetActive(i < requiredGhosts);
float mult = 1f - Mathf.Pow((float)i / maxGhosts, 2);
ghostSlider.transform.FindDeepChild("Handle").GetComponent<Image>().color = new Color(0, 0.5f, 0.5f, 0.5f * mult);
}
if (i >= nGhosts)
{ transform.GetChild(i).gameObject.SetActive(false); }
Slider ghostSlider = ghostSliderObject.GetComponent<Slider>();
ghostSlider.maxValue = Workspace.StageWindowSize;
ghostSlider.value = targetTick;
if (targetTick > ghostSlider.maxValue)
{ ghostSlider.gameObject.SetActive(false); }
}
}
@ -98,9 +95,9 @@ namespace RimWorldAnimationStudio
Workspace.keyframeID = keyframeID;
if (eventData.clickCount >= 2)
{
AnimationController.Instance.stageTick = keyframe.atTick.Value;
}
{ AnimationController.Instance.stageTick = keyframe.atTick.Value; }
Workspace.Instance.MakeDirty();
}
public void OnBeginDrag(PointerEventData eventData)
@ -126,6 +123,8 @@ namespace RimWorldAnimationStudio
public void OnEndDrag(PointerEventData eventData)
{
interactable = false;
Workspace.Instance.MakeDirty();
}
protected override void Update()

View File

@ -16,6 +16,10 @@ namespace RimWorldAnimationStudio
{
stageName.text = stageNameField.text;
stageNameField.gameObject.SetActive(false);
Workspace.animationDef.animationStages[Workspace.stageID].stageName = stageName.text;
Workspace.Instance.MakeDirty();
}
public void OnMoveStage(int delta)
@ -60,8 +64,7 @@ namespace RimWorldAnimationStudio
Workspace.stageID = transform.GetSiblingIndex();
//AnimationController.Instance.ResetAnimationTimeline();
//AnimationController.Instance.InitializeAnimationTimeline();
Workspace.Instance.MakeDirty();
}
}
}

View File

@ -34,14 +34,22 @@ namespace RimWorldAnimationStudio
private int lastStageTick = 1;
private float timeSinceLastUpdate = 0;
private int cycleIndex = 0;
private bool isDirty = true;
private bool isTimelineDirty = true;
public void MakeDirty()
{ isDirty = true; }
public void MakeTimelineDirty()
{ isTimelineDirty = true; }
public void Update()
{
// No animation, exit
if (Workspace.animationDef == null) { return; }
// Dirty animation, reset
if (Workspace.animationDef != null && Workspace.isDirty)
if (Workspace.animationDef != null && isDirty)
{ Initialize(); return; }
// Update tick if animating
@ -65,14 +73,11 @@ namespace RimWorldAnimationStudio
++cycleIndex;
stageTick = 1;
if ((stageLoopDropdown.value == 2 && cycleIndex > int.Parse(cyclesNormalField.text)) ||
(stageLoopDropdown.value == 3 && cycleIndex > int.Parse(cyclesFastField.text)))
if ((stageLoopDropdown.value == 2 && cycleIndex >= int.Parse(cyclesNormalField.text)) ||
(stageLoopDropdown.value == 3 && cycleIndex >= int.Parse(cyclesFastField.text)))
{
++Workspace.stageID;
cycleIndex = 0;
//ResetAnimationTimeline();
//InitializeAnimationTimeline();
}
}
@ -99,7 +104,7 @@ namespace RimWorldAnimationStudio
public void UpdateAnimation()
{
if (Workspace.Instance.AnimationTimelinesNeedUpdate())
if (AnimationTimelinesNeedUpdate())
{
ResetAnimationTimeline();
InitializeAnimationTimeline();
@ -109,6 +114,12 @@ namespace RimWorldAnimationStudio
for (int actorID = 0; actorID < actorBodies.Count; actorID++)
{
if (Workspace.stageID >= Workspace.animationDef?.animationStages.Count)
{ Debug.Log("Waiting for animation stage data to initialize..."); return; }
if (actorID >= Workspace.animationDef?.animationStages[Workspace.stageID]?.animationClips.Count)
{ Debug.Log("Waiting for animation clip data to initialize..."); return; }
PawnAnimationClip clip = Workspace.animationDef?.animationStages[Workspace.stageID]?.animationClips[actorID];
if (clip == null)
@ -162,7 +173,7 @@ namespace RimWorldAnimationStudio
InitializeAnimationTimeline();
StageCardManager.Instance.Initialize();
Workspace.isDirty = false;
isDirty = false;
}
public void InitializeAnimationTimeline()
@ -184,6 +195,8 @@ namespace RimWorldAnimationStudio
stageTimelineSlider.maxValue = Workspace.StageWindowSize;
stageTimelineSlider.value = 1;
stageTick = 1;
isTimelineDirty = false;
}
public void Reset()
@ -209,7 +222,9 @@ namespace RimWorldAnimationStudio
public bool AddAnimationStage()
{
AnimationStage stage = new AnimationStage();
Workspace.Instance.MakeDirty();
return stage.MakeNew();
}
@ -221,6 +236,8 @@ namespace RimWorldAnimationStudio
Workspace.animationDef.animationStages.Insert(Workspace.stageID + 1, stage);
Workspace.Instance.MakeDirty();
return true;
}
@ -233,6 +250,8 @@ namespace RimWorldAnimationStudio
Workspace.animationDef.animationStages[startIndex] = Workspace.animationDef.animationStages[startIndex + delta];
Workspace.animationDef.animationStages[startIndex + delta] = stage;
Workspace.Instance.MakeDirty();
return true;
}
@ -247,15 +266,17 @@ namespace RimWorldAnimationStudio
Workspace.animationDef.animationStages.RemoveAt(Workspace.stageID);
Workspace.stageID = Workspace.stageID >= Workspace.animationDef.animationStages.Count ? Workspace.stageID = Workspace.animationDef.animationStages.Count - 1 : Workspace.stageID;
Workspace.Instance.MakeDirty();
return true;
}
public void AddActor()
{
Actor actor = new Actor();
actor.MakeNew();
if (actor.MakeNew())
{ Initialize(); }
Workspace.Instance.MakeDirty();
}
public void RemoveActor()
@ -272,7 +293,7 @@ namespace RimWorldAnimationStudio
Workspace.animationDef.actors.RemoveAt(Workspace.actorID);
Workspace.actorID = Workspace.actorID >= Workspace.animationDef.actors.Count ? Workspace.actorID = Workspace.animationDef.actors.Count - 1 : Workspace.actorID;
Initialize();
Workspace.Instance.MakeDirty();
}
public void AddPawnKeyframe()
@ -311,11 +332,15 @@ namespace RimWorldAnimationStudio
clip.BuildSimpleCurves();
animationTimelines.GetComponentsInChildren<AnimationTimeline>()[Workspace.actorID].AddPawnKeyFrame(keyframe.keyframeID);
Workspace.Instance.MakeDirty();
}
public void RemovePawnKeyframe()
{
RemovePawnKeyframe(Workspace.actorID, Workspace.keyframeID);
Workspace.Instance.MakeDirty();
}
public void RemovePawnKeyframe(int actorID, int keyframeID)
@ -333,6 +358,8 @@ namespace RimWorldAnimationStudio
clip.keyframes.Remove(keyframe);
clip.BuildSimpleCurves();
}
Workspace.Instance.MakeDirty();
}
public void ToggleAnimation()
@ -363,6 +390,8 @@ namespace RimWorldAnimationStudio
int.TryParse(animationClipTimeField.text, out int newStageTick);
stageTick = Mathf.Clamp(newStageTick, 1, Workspace.StageWindowSize);
stageTimelineSlider.value = stageTick;
Workspace.Instance.MakeDirty();
}
public void OnAnimationClipLengthFieldChange()
@ -394,8 +423,7 @@ namespace RimWorldAnimationStudio
animationClipLengthField.text = newstageWindowSize.ToString();
Workspace.animationDef.animationStages[Workspace.stageID].stageWindowSize = newstageWindowSize;
//ResetAnimationTimeline();
//InitializeAnimationTimeline();
Workspace.Instance.MakeDirty();
}
public void OnCycleNormalFieldChange()
@ -404,6 +432,8 @@ namespace RimWorldAnimationStudio
if (int.TryParse(cyclesNormalField.text, out int cycles))
{ Workspace.animationDef.animationStages[Workspace.stageID].playTimeTicks = cycles * Workspace.StageWindowSize; }
Workspace.Instance.MakeDirty();
}
public void OnCycleFastFieldChange()
@ -412,6 +442,44 @@ namespace RimWorldAnimationStudio
if (int.TryParse(cyclesFastField.text, out int cycles))
{ Workspace.animationDef.animationStages[Workspace.stageID].playTimeTicksQuick = cycles * Workspace.StageWindowSize; }
Workspace.Instance.MakeDirty();
}
private int lastactorCount = 0;
private int lastStageID = 0;
private int lastStageCount = 0;
private int lastStageWindowSize = 0;
public bool AnimationTimelinesNeedUpdate()
{
if (Workspace.animationDef == null) return false;
bool update = isTimelineDirty;
if (lastStageID != Workspace.stageID)
{ update = true; }
if (lastStageCount != Workspace.animationDef.animationStages.Count)
{ update = true; }
if (lastactorCount != Workspace.animationDef.actors.Count)
{ update = true; }
if (lastStageWindowSize != Workspace.StageWindowSize)
{ update = true; }
if (update)
{
lastStageID = Workspace.stageID;
lastStageCount = Workspace.animationDef.animationStages.Count;
lastactorCount = Workspace.animationDef.actors.Count;
lastStageWindowSize = Workspace.StageWindowSize;
return true;
}
return false;
}
}
}

View File

@ -46,11 +46,15 @@ namespace RimWorldAnimationStudio
public void LoadAnimation(AnimationDef animationDef)
{
animationDef.RunPostLoadOperations();
Debug.Log("Loaded AnimationDef: " + animationDef.defName);
Workspace.animationDef = animationDef;
animationDef.Initialize();
Workspace.isDirty = true;
Workspace.Instance.ClearHistory();
Workspace.Instance.MakeDirty();
AnimationController.Instance.MakeDirty();
var animationDefCards = Resources.FindObjectsOfTypeAll(typeof(AnimationDefCard)) as AnimationDefCard[];
@ -78,16 +82,8 @@ namespace RimWorldAnimationStudio
{
Debug.Log("Saving AnimationDef: " + Workspace.animationDef.defName);
AnimationDef animationDef = Workspace.animationDef;
foreach (AnimationStage stage in animationDef.animationStages)
{
foreach (PawnAnimationClip clip in stage.animationClips)
{
clip.keyframes = clip.keyframes.OrderBy(x => x.atTick).ToList();
}
}
AnimationDef animationDef = Workspace.animationDef.Copy();
animationDef.RunPreSaveOperations();
Defs defs = new Defs();
defs.animationDefs.Add(animationDef);
@ -104,7 +100,7 @@ namespace RimWorldAnimationStudio
// Add one stage, add one actor, add one clip, add one frame
Workspace.animationDef = new AnimationDef();
Workspace.isDirty = true;
Workspace.Instance.MakeDirty();
var animationDefCards = Resources.FindObjectsOfTypeAll(typeof(AnimationDefCard)) as GameObject[];

View File

@ -18,5 +18,6 @@ namespace RimWorldAnimationStudio
public static Color ColorRichOrange = new Color(1.0f, 0.4f, 0.1f);
public static Color ColorCyan = new Color(0.0f, 1.0f, 1.0f);
public static Color ColorPurple = new Color(0.85f, 0.0f, 1.0f);
public static Color ColorGhost = new Color(0.5f, 0.5f, 0.5f, 0.5f);
}
}

View File

@ -39,11 +39,6 @@ namespace RimWorldAnimationStudio
}
}
private void Awake()
{
DontDestroyOnLoad(this.gameObject);
}
private void OnDestroy()
{
shuttingDown = true;

View File

@ -12,18 +12,18 @@ namespace RimWorldAnimationStudio
public static AnimationDef animationDef;
public static int stageID = 0;
public static int actorID = 0;
public static int keyframeID = 0;
public static bool isDirty = false;
public static int keyframeID = 0;
public static List<string> defNames = new List<string>() { "Human" };
public static List<string> bodyParts = new List<string>() { "Penis", "Vagina", "Anus", "Breasts", "Mouth" };
public static List<string> bodyParts = new List<string>() { "Any appendage", "Any orifice", "Penis", "Vagina", "Anus", "Breasts", "Mouth" };
public static List<string> bodyDefTypes = new List<string>() { "Human" };
public static List<string> sexTypes = new List<string>() { "None", "Vaginal", "Anal", "Oral", "Masturbation", "DoublePenetration", "Boobjob", "Handjob", "Footjob", "Fingering", "Scissoring", "MutualMasturbation", "Fisting", "MechImplant", "Rimming", "Fellatio", "Cunnilingus", "Sixtynine" };
public static List<string> interactionDefTypes = new List<string>();
private static List<WorkspaceSnapShot> workspaceHistory = new List<WorkspaceSnapShot>();
private static int maxHistoryDepth = 100;
private static int historyIndex = 0;
[SerializeField] private List<WorkspaceSnapShot> workspaceHistory = new List<WorkspaceSnapShot>();
[SerializeField] private int historyIndex = 0;
[SerializeField] private int maxHistoryDepth = 100;
private bool isDirty = false;
public static ActorManipulationMode actorManipulationMode = ActorManipulationMode.Pan;
@ -41,6 +41,12 @@ namespace RimWorldAnimationStudio
}
}
public void Update()
{
if (isDirty)
{ TrackChanges(); }
}
public PawnKeyframe GetCurrentPawnKeyframe()
{
int stageTick = AnimationController.Instance.stageTick;
@ -70,21 +76,26 @@ namespace RimWorldAnimationStudio
public void TrackChanges()
{
Debug.Log("Test");
Debug.Log(historyIndex + 1);
Debug.Log(workspaceHistory.Count - historyIndex);
if (historyIndex < workspaceHistory.Count - 1)
{ workspaceHistory.RemoveRange(historyIndex + 1, workspaceHistory.Count - historyIndex); }
{ workspaceHistory.RemoveRange(historyIndex + 1, workspaceHistory.Count - historyIndex - 1); }
if (workspaceHistory.Any() && workspaceHistory.Count >= maxHistoryDepth)
{ workspaceHistory.RemoveAt(0); }
WorkspaceSnapShot workspaceSnapShot = new WorkspaceSnapShot();
workspaceSnapShot.animationDef = animationDef;
workspaceSnapShot.animationDef = animationDef.Copy();
workspaceSnapShot.stageID = stageID;
workspaceSnapShot.actorID = actorID;
workspaceSnapShot.keyframeID = keyframeID;
workspaceHistory.Add(workspaceSnapShot);
historyIndex = workspaceHistory.Count - 1;
// track bType for actors, stageID, isdirty
historyIndex++;
isDirty = false;
}
public void Undo()
@ -95,51 +106,30 @@ namespace RimWorldAnimationStudio
public void Redo()
{
historyIndex = Mathf.Clamp(historyIndex - 1, 0, workspaceHistory.Count - 1);
historyIndex = Mathf.Clamp(historyIndex + 1, 0, workspaceHistory.Count - 1);
LoadHistoricState();
}
public void LoadHistoricState()
{
animationDef = workspaceHistory[historyIndex].animationDef;
if (workspaceHistory.NullOrEmpty())
{ Debug.LogWarning("Cannot load historic state - workspace history is empty"); return; }
// All other data
animationDef = workspaceHistory[historyIndex].animationDef.Copy();
stageID = workspaceHistory[historyIndex].stageID;
actorID = workspaceHistory[historyIndex].actorID;
keyframeID = workspaceHistory[historyIndex].keyframeID;
AnimationController.Instance.MakeTimelineDirty();
}
private int lastactorCount = 0;
private int lastStageID = 0;
private int lastStageCount = 0;
private int lastStageWindowSize = 0;
public bool AnimationTimelinesNeedUpdate()
public void ClearHistory()
{
if (animationDef == null) return false;
bool update = false;
if (lastStageID != stageID)
{ update = true; }
if (lastStageCount != animationDef.animationStages.Count)
{ update = true; }
if (lastactorCount != animationDef.actors.Count)
{ update = true; }
if (lastStageWindowSize != StageWindowSize)
{ update = true; }
if (update)
{
lastStageID = stageID;
lastStageCount = animationDef.animationStages.Count;
lastactorCount = animationDef.actors.Count;
lastStageWindowSize = StageWindowSize;
return true;
}
return false;
workspaceHistory.Clear();
historyIndex = 0;
}
public void MakeDirty()
{ isDirty = true; }
}
}

View File

@ -6,9 +6,12 @@ using System.Threading.Tasks;
namespace RimWorldAnimationStudio
{
[Serializable]
public class WorkspaceSnapShot
{
public AnimationDef animationDef;
public int stageID = 0;
public int actorID = 0;
public int keyframeID = 0;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More