You've already forked UniversalViewer
							
							DanMachi:
-compatibility improvements Core: -simplified object and keyframe serialization -complicated assetbundle loading
This commit is contained in:
		
							
								
								
									
										40248
									
								
								Assets/KF3/KF3.unity
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40248
									
								
								Assets/KF3/KF3.unity
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										7
									
								
								Assets/KF3/KF3.unity.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/KF3/KF3.unity.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 50cd194efc5f9c44d9b6ee9079abd64d | ||||
| DefaultImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										8
									
								
								Assets/KF3/Prefabs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Assets/KF3/Prefabs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: c0a907902af71e44aaab7696de8c5b0c | ||||
| folderAsset: yes | ||||
| DefaultImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										8
									
								
								Assets/KF3/Prefabs/UI.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Assets/KF3/Prefabs/UI.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 725384a4561b63d4baa344c060b5e015 | ||||
| folderAsset: yes | ||||
| DefaultImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										9177
									
								
								Assets/KF3/Prefabs/UI/CharacterPanel.prefab
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9177
									
								
								Assets/KF3/Prefabs/UI/CharacterPanel.prefab
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										7
									
								
								Assets/KF3/Prefabs/UI/CharacterPanel.prefab.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/KF3/Prefabs/UI/CharacterPanel.prefab.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 50ed82b5576a8274fbef3e9850fafadd | ||||
| PrefabImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										1982
									
								
								Assets/KF3/Prefabs/UI/FriendMorphPanel.prefab
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1982
									
								
								Assets/KF3/Prefabs/UI/FriendMorphPanel.prefab
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										7
									
								
								Assets/KF3/Prefabs/UI/FriendMorphPanel.prefab.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/KF3/Prefabs/UI/FriendMorphPanel.prefab.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: bf21dae47f1e1b74faf8be16bb74c2dc | ||||
| PrefabImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										989
									
								
								Assets/KF3/Prefabs/UI/MorphSlider.prefab
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										989
									
								
								Assets/KF3/Prefabs/UI/MorphSlider.prefab
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,989 @@ | ||||
| %YAML 1.1 | ||||
| %TAG !u! tag:unity3d.com,2011: | ||||
| --- !u!1 &406419102996990435 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 4779939240792789388} | ||||
|   - component: {fileID: 1584950039069069924} | ||||
|   - component: {fileID: 3262512346737592932} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Text (TMP) | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &4779939240792789388 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 406419102996990435} | ||||
|   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: 4184826984943928819} | ||||
|   m_RootOrder: 1 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0} | ||||
|   m_AnchorMax: {x: 1, y: 1} | ||||
|   m_AnchoredPosition: {x: 9, y: -0.5} | ||||
|   m_SizeDelta: {x: -28, y: -3} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &1584950039069069924 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 406419102996990435} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &3262512346737592932 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 406419102996990435} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   m_Material: {fileID: 0} | ||||
|   m_Color: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_RaycastTarget: 1 | ||||
|   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_text: Toggle | ||||
|   m_isRightToLeft: 0 | ||||
|   m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} | ||||
|   m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} | ||||
|   m_fontSharedMaterials: [] | ||||
|   m_fontMaterial: {fileID: 0} | ||||
|   m_fontMaterials: [] | ||||
|   m_fontColor32: | ||||
|     serializedVersion: 2 | ||||
|     rgba: 4281479730 | ||||
|   m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} | ||||
|   m_enableVertexGradient: 0 | ||||
|   m_colorMode: 3 | ||||
|   m_fontColorGradient: | ||||
|     topLeft: {r: 1, g: 1, b: 1, a: 1} | ||||
|     topRight: {r: 1, g: 1, b: 1, a: 1} | ||||
|     bottomLeft: {r: 1, g: 1, b: 1, a: 1} | ||||
|     bottomRight: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_fontColorGradientPreset: {fileID: 0} | ||||
|   m_spriteAsset: {fileID: 0} | ||||
|   m_tintAllSprites: 0 | ||||
|   m_StyleSheet: {fileID: 0} | ||||
|   m_TextStyleHashCode: -1183493901 | ||||
|   m_overrideHtmlColors: 0 | ||||
|   m_faceColor: | ||||
|     serializedVersion: 2 | ||||
|     rgba: 4294967295 | ||||
|   m_fontSize: 14 | ||||
|   m_fontSizeBase: 14 | ||||
|   m_fontWeight: 400 | ||||
|   m_enableAutoSizing: 0 | ||||
|   m_fontSizeMin: 18 | ||||
|   m_fontSizeMax: 72 | ||||
|   m_fontStyle: 0 | ||||
|   m_HorizontalAlignment: 1 | ||||
|   m_VerticalAlignment: 256 | ||||
|   m_textAlignment: 65535 | ||||
|   m_characterSpacing: 0 | ||||
|   m_wordSpacing: 0 | ||||
|   m_lineSpacing: 0 | ||||
|   m_lineSpacingMax: 0 | ||||
|   m_paragraphSpacing: 0 | ||||
|   m_charWidthMaxAdj: 0 | ||||
|   m_enableWordWrapping: 1 | ||||
|   m_wordWrappingRatios: 0.4 | ||||
|   m_overflowMode: 0 | ||||
|   m_linkedTextComponent: {fileID: 0} | ||||
|   parentLinkedComponent: {fileID: 0} | ||||
|   m_enableKerning: 1 | ||||
|   m_enableExtraPadding: 0 | ||||
|   checkPaddingRequired: 0 | ||||
|   m_isRichText: 1 | ||||
|   m_parseCtrlCharacters: 1 | ||||
|   m_isOrthographic: 1 | ||||
|   m_isCullingEnabled: 0 | ||||
|   m_horizontalMapping: 0 | ||||
|   m_verticalMapping: 0 | ||||
|   m_uvLineOffset: 0 | ||||
|   m_geometrySortingOrder: 0 | ||||
|   m_IsTextObjectScaleStatic: 0 | ||||
|   m_VertexBufferAutoSizeReduction: 0 | ||||
|   m_useMaxVisibleDescender: 1 | ||||
|   m_pageToDisplay: 1 | ||||
|   m_margin: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_isUsingLegacyAnimationComponent: 0 | ||||
|   m_isVolumetricText: 0 | ||||
|   m_hasFontAssetChanged: 0 | ||||
|   m_baseMaterial: {fileID: 0} | ||||
|   m_maskOffset: {x: 0, y: 0, z: 0, w: 0} | ||||
| --- !u!1 &1451225421186468728 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 5101148945640598805} | ||||
|   - component: {fileID: 1160409419726520999} | ||||
|   m_Layer: 5 | ||||
|   m_Name: MorphSlider | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &5101148945640598805 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 1451225421186468728} | ||||
|   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: 5882853902430253298} | ||||
|   - {fileID: 5203495626939517929} | ||||
|   - {fileID: 4308357552645940838} | ||||
|   m_Father: {fileID: 6787305365772754371} | ||||
|   m_RootOrder: 1 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0} | ||||
|   m_AnchorMax: {x: 1, y: 0} | ||||
|   m_AnchoredPosition: {x: 0.000061035156, y: 0.000030517578} | ||||
|   m_SizeDelta: {x: -10, y: 20} | ||||
|   m_Pivot: {x: 0.5, y: 0} | ||||
| --- !u!114 &1160409419726520999 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 1451225421186468728} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   m_Navigation: | ||||
|     m_Mode: 3 | ||||
|     m_WrapAround: 0 | ||||
|     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: 3984808659029867453} | ||||
|   m_FillRect: {fileID: 7434744616954175478} | ||||
|   m_HandleRect: {fileID: 6096567429521374474} | ||||
|   m_Direction: 0 | ||||
|   m_MinValue: 0 | ||||
|   m_MaxValue: 100 | ||||
|   m_WholeNumbers: 1 | ||||
|   m_Value: 0 | ||||
|   m_OnValueChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
| --- !u!1 &2023615170869959625 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 5203495626939517929} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Fill Area | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &5203495626939517929 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2023615170869959625} | ||||
|   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: 7434744616954175478} | ||||
|   m_Father: {fileID: 5101148945640598805} | ||||
|   m_RootOrder: 1 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0.25} | ||||
|   m_AnchorMax: {x: 1, y: 0.75} | ||||
|   m_AnchoredPosition: {x: -5, y: 0} | ||||
|   m_SizeDelta: {x: -20, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!1 &2471763352390373912 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 4308357552645940838} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Handle Slide Area | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &4308357552645940838 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2471763352390373912} | ||||
|   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: 6096567429521374474} | ||||
|   m_Father: {fileID: 5101148945640598805} | ||||
|   m_RootOrder: 2 | ||||
|   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: -20, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!1 &2510049255526463552 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 6096567429521374474} | ||||
|   - component: {fileID: 4742402777936722718} | ||||
|   - component: {fileID: 3984808659029867453} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Handle | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &6096567429521374474 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2510049255526463552} | ||||
|   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: 4308357552645940838} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0} | ||||
|   m_AnchorMax: {x: 0, y: 0} | ||||
|   m_AnchoredPosition: {x: 0, y: 0} | ||||
|   m_SizeDelta: {x: 20, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &4742402777936722718 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2510049255526463552} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &3984808659029867453 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2510049255526463552} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} | ||||
|   m_Type: 0 | ||||
|   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!1 &3594065669119621667 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 6787305365772754371} | ||||
|   - component: {fileID: 5212221834949504815} | ||||
|   - component: {fileID: 7351176722807286657} | ||||
|   - component: {fileID: 1764505660656797435} | ||||
|   m_Layer: 5 | ||||
|   m_Name: MorphSlider | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &6787305365772754371 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   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: 1283946357276694583} | ||||
|   - {fileID: 5101148945640598805} | ||||
|   - {fileID: 4184826984943928819} | ||||
|   m_Father: {fileID: 0} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 1} | ||||
|   m_AnchorMax: {x: 0, y: 1} | ||||
|   m_AnchoredPosition: {x: 983, y: -294} | ||||
|   m_SizeDelta: {x: 170, y: 36} | ||||
|   m_Pivot: {x: 0, y: 1} | ||||
| --- !u!222 &5212221834949504815 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &7351176722807286657 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   m_Enabled: 0 | ||||
|   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: 0.392} | ||||
|   m_RaycastTarget: 1 | ||||
|   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 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!114 &1764505660656797435 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: ce70097e989567b4c8cdc841bea38e7c, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   Slider: {fileID: 1160409419726520999} | ||||
|   ToggleCallbacks: {fileID: 0} | ||||
|   Text: {fileID: 3808922627261925310} | ||||
|   Toggle: {fileID: 8264476568868939848} | ||||
| --- !u!1 &6639914104638231064 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 3626829940778144311} | ||||
|   - component: {fileID: 8769834181534787845} | ||||
|   - component: {fileID: 2562180160881843108} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Background | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &3626829940778144311 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6639914104638231064} | ||||
|   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: 2149453652001172432} | ||||
|   m_Father: {fileID: 4184826984943928819} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 1} | ||||
|   m_AnchorMax: {x: 0, y: 1} | ||||
|   m_AnchoredPosition: {x: 10, y: -10} | ||||
|   m_SizeDelta: {x: 20, y: 20} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &8769834181534787845 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6639914104638231064} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &2562180160881843108 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6639914104638231064} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   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!1 &6739384456699907057 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 7434744616954175478} | ||||
|   - component: {fileID: 956272652380745244} | ||||
|   - component: {fileID: 6569251248387748135} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Fill | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &7434744616954175478 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6739384456699907057} | ||||
|   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: 5203495626939517929} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0} | ||||
|   m_AnchorMax: {x: 0, y: 0} | ||||
|   m_AnchoredPosition: {x: 0, y: 0} | ||||
|   m_SizeDelta: {x: 10, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &956272652380745244 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6739384456699907057} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &6569251248387748135 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6739384456699907057} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   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!1 &6858770152562268284 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 2149453652001172432} | ||||
|   - component: {fileID: 7693030575685829328} | ||||
|   - component: {fileID: 3149754566040842011} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Checkmark | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &2149453652001172432 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6858770152562268284} | ||||
|   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: 3626829940778144311} | ||||
|   m_RootOrder: 0 | ||||
|   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: 0, y: 0} | ||||
|   m_SizeDelta: {x: 20, y: 20} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &7693030575685829328 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6858770152562268284} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &3149754566040842011 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6858770152562268284} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} | ||||
|   m_Type: 0 | ||||
|   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!1 &6934912295437609305 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 4184826984943928819} | ||||
|   - component: {fileID: 8264476568868939848} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Toggle | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 0 | ||||
| --- !u!224 &4184826984943928819 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6934912295437609305} | ||||
|   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: 3626829940778144311} | ||||
|   - {fileID: 4779939240792789388} | ||||
|   m_Father: {fileID: 6787305365772754371} | ||||
|   m_RootOrder: 2 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0.5, y: 0} | ||||
|   m_AnchorMax: {x: 0.5, y: 0} | ||||
|   m_AnchoredPosition: {x: 0.000015258789, y: 5} | ||||
|   m_SizeDelta: {x: 160, y: 20} | ||||
|   m_Pivot: {x: 0.5, y: 0} | ||||
| --- !u!114 &8264476568868939848 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6934912295437609305} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   m_Navigation: | ||||
|     m_Mode: 3 | ||||
|     m_WrapAround: 0 | ||||
|     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: 2562180160881843108} | ||||
|   toggleTransition: 1 | ||||
|   graphic: {fileID: 3149754566040842011} | ||||
|   m_Group: {fileID: 0} | ||||
|   onValueChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_IsOn: 1 | ||||
| --- !u!1 &8095447207275656126 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 1283946357276694583} | ||||
|   - component: {fileID: 9132769058287262584} | ||||
|   - component: {fileID: 3808922627261925310} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Text (TMP) | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &1283946357276694583 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8095447207275656126} | ||||
|   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: 6787305365772754371} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 1} | ||||
|   m_AnchorMax: {x: 1, y: 1} | ||||
|   m_AnchoredPosition: {x: 0, y: -0.000030517578} | ||||
|   m_SizeDelta: {x: 0, y: 20} | ||||
|   m_Pivot: {x: 0.5, y: 1} | ||||
| --- !u!222 &9132769058287262584 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8095447207275656126} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &3808922627261925310 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8095447207275656126} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   m_Material: {fileID: 0} | ||||
|   m_Color: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_RaycastTarget: 1 | ||||
|   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_text: New Text | ||||
|   m_isRightToLeft: 0 | ||||
|   m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} | ||||
|   m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} | ||||
|   m_fontSharedMaterials: [] | ||||
|   m_fontMaterial: {fileID: 0} | ||||
|   m_fontMaterials: [] | ||||
|   m_fontColor32: | ||||
|     serializedVersion: 2 | ||||
|     rgba: 4294967295 | ||||
|   m_fontColor: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_enableVertexGradient: 0 | ||||
|   m_colorMode: 3 | ||||
|   m_fontColorGradient: | ||||
|     topLeft: {r: 1, g: 1, b: 1, a: 1} | ||||
|     topRight: {r: 1, g: 1, b: 1, a: 1} | ||||
|     bottomLeft: {r: 1, g: 1, b: 1, a: 1} | ||||
|     bottomRight: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_fontColorGradientPreset: {fileID: 0} | ||||
|   m_spriteAsset: {fileID: 0} | ||||
|   m_tintAllSprites: 0 | ||||
|   m_StyleSheet: {fileID: 0} | ||||
|   m_TextStyleHashCode: -1183493901 | ||||
|   m_overrideHtmlColors: 0 | ||||
|   m_faceColor: | ||||
|     serializedVersion: 2 | ||||
|     rgba: 4294967295 | ||||
|   m_fontSize: 16 | ||||
|   m_fontSizeBase: 16 | ||||
|   m_fontWeight: 400 | ||||
|   m_enableAutoSizing: 0 | ||||
|   m_fontSizeMin: 18 | ||||
|   m_fontSizeMax: 72 | ||||
|   m_fontStyle: 0 | ||||
|   m_HorizontalAlignment: 2 | ||||
|   m_VerticalAlignment: 256 | ||||
|   m_textAlignment: 65535 | ||||
|   m_characterSpacing: 0 | ||||
|   m_wordSpacing: 0 | ||||
|   m_lineSpacing: 0 | ||||
|   m_lineSpacingMax: 0 | ||||
|   m_paragraphSpacing: 0 | ||||
|   m_charWidthMaxAdj: 0 | ||||
|   m_enableWordWrapping: 1 | ||||
|   m_wordWrappingRatios: 0.4 | ||||
|   m_overflowMode: 0 | ||||
|   m_linkedTextComponent: {fileID: 0} | ||||
|   parentLinkedComponent: {fileID: 0} | ||||
|   m_enableKerning: 1 | ||||
|   m_enableExtraPadding: 0 | ||||
|   checkPaddingRequired: 0 | ||||
|   m_isRichText: 1 | ||||
|   m_parseCtrlCharacters: 1 | ||||
|   m_isOrthographic: 1 | ||||
|   m_isCullingEnabled: 0 | ||||
|   m_horizontalMapping: 0 | ||||
|   m_verticalMapping: 0 | ||||
|   m_uvLineOffset: 0 | ||||
|   m_geometrySortingOrder: 0 | ||||
|   m_IsTextObjectScaleStatic: 0 | ||||
|   m_VertexBufferAutoSizeReduction: 0 | ||||
|   m_useMaxVisibleDescender: 1 | ||||
|   m_pageToDisplay: 1 | ||||
|   m_margin: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_isUsingLegacyAnimationComponent: 0 | ||||
|   m_isVolumetricText: 0 | ||||
|   m_hasFontAssetChanged: 0 | ||||
|   m_baseMaterial: {fileID: 0} | ||||
|   m_maskOffset: {x: 0, y: 0, z: 0, w: 0} | ||||
| --- !u!1 &8136949952947563388 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 5882853902430253298} | ||||
|   - component: {fileID: 8404216737247336084} | ||||
|   - component: {fileID: 6857429999625137368} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Background | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &5882853902430253298 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8136949952947563388} | ||||
|   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: 5101148945640598805} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0.25} | ||||
|   m_AnchorMax: {x: 1, y: 0.75} | ||||
|   m_AnchoredPosition: {x: 0, y: 0} | ||||
|   m_SizeDelta: {x: 0, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &8404216737247336084 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8136949952947563388} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &6857429999625137368 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8136949952947563388} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 10907, 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 | ||||
							
								
								
									
										7
									
								
								Assets/KF3/Prefabs/UI/MorphSlider.prefab.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/KF3/Prefabs/UI/MorphSlider.prefab.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: b2d0521d1dc319e418a688922476c31a | ||||
| PrefabImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										485
									
								
								Assets/KF3/Prefabs/UI/MorphToggle.prefab
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										485
									
								
								Assets/KF3/Prefabs/UI/MorphToggle.prefab
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,485 @@ | ||||
| %YAML 1.1 | ||||
| %TAG !u! tag:unity3d.com,2011: | ||||
| --- !u!1 &3594065669119621667 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 6787305365772754371} | ||||
|   - component: {fileID: 5212221834949504815} | ||||
|   - component: {fileID: 7351176722807286657} | ||||
|   - component: {fileID: 1764505660656797435} | ||||
|   m_Layer: 5 | ||||
|   m_Name: MorphToggle | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &6787305365772754371 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   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: 1283946357276694583} | ||||
|   - {fileID: 4184826984943928819} | ||||
|   m_Father: {fileID: 0} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 1} | ||||
|   m_AnchorMax: {x: 0, y: 1} | ||||
|   m_AnchoredPosition: {x: 983, y: -294} | ||||
|   m_SizeDelta: {x: 170, y: 36} | ||||
|   m_Pivot: {x: 0, y: 1} | ||||
| --- !u!222 &5212221834949504815 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &7351176722807286657 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   m_Enabled: 0 | ||||
|   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: 0.392} | ||||
|   m_RaycastTarget: 1 | ||||
|   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 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!114 &1764505660656797435 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: ce70097e989567b4c8cdc841bea38e7c, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   Slider: {fileID: 0} | ||||
|   ToggleCallbacks: {fileID: 8844218806920435032} | ||||
|   Text: {fileID: 3808922627261925310} | ||||
|   Toggle: {fileID: 8264476568868939848} | ||||
| --- !u!1 &6639914104638231064 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 3626829940778144311} | ||||
|   - component: {fileID: 8769834181534787845} | ||||
|   - component: {fileID: 2562180160881843108} | ||||
|   - component: {fileID: 8844218806920435032} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Background | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &3626829940778144311 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6639914104638231064} | ||||
|   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: 2149453652001172432} | ||||
|   m_Father: {fileID: 4184826984943928819} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 1} | ||||
|   m_AnchorMax: {x: 0, y: 1} | ||||
|   m_AnchoredPosition: {x: 10, y: -10} | ||||
|   m_SizeDelta: {x: 25, y: 25} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &8769834181534787845 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6639914104638231064} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &2562180160881843108 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6639914104638231064} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   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!114 &8844218806920435032 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6639914104638231064} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: 902f33e1b15fa0d40b8eefd09e3ab28f, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   MouseHover: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   MouseHoverEnd: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
| --- !u!1 &6858770152562268284 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 2149453652001172432} | ||||
|   - component: {fileID: 7693030575685829328} | ||||
|   - component: {fileID: 3149754566040842011} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Checkmark | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &2149453652001172432 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6858770152562268284} | ||||
|   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: 3626829940778144311} | ||||
|   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.000015258789, y: 0} | ||||
|   m_SizeDelta: {x: 0, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &7693030575685829328 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6858770152562268284} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &3149754566040842011 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6858770152562268284} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} | ||||
|   m_Type: 0 | ||||
|   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!1 &6934912295437609305 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 4184826984943928819} | ||||
|   - component: {fileID: 8264476568868939848} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Toggle | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &4184826984943928819 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6934912295437609305} | ||||
|   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: 3626829940778144311} | ||||
|   m_Father: {fileID: 6787305365772754371} | ||||
|   m_RootOrder: 1 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0.5} | ||||
|   m_AnchorMax: {x: 0, y: 0.5} | ||||
|   m_AnchoredPosition: {x: 10, y: 0} | ||||
|   m_SizeDelta: {x: 160, y: 20} | ||||
|   m_Pivot: {x: 0, y: 0.5} | ||||
| --- !u!114 &8264476568868939848 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6934912295437609305} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   m_Navigation: | ||||
|     m_Mode: 3 | ||||
|     m_WrapAround: 0 | ||||
|     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: 2562180160881843108} | ||||
|   toggleTransition: 1 | ||||
|   graphic: {fileID: 3149754566040842011} | ||||
|   m_Group: {fileID: 0} | ||||
|   onValueChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_IsOn: 1 | ||||
| --- !u!1 &8095447207275656126 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 1283946357276694583} | ||||
|   - component: {fileID: 9132769058287262584} | ||||
|   - component: {fileID: 3808922627261925310} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Text (TMP) | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &1283946357276694583 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8095447207275656126} | ||||
|   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: 6787305365772754371} | ||||
|   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: 20.000002, y: 0} | ||||
|   m_SizeDelta: {x: -39.999996, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &9132769058287262584 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8095447207275656126} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &3808922627261925310 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8095447207275656126} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   m_Material: {fileID: 0} | ||||
|   m_Color: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_RaycastTarget: 1 | ||||
|   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_text: New Text | ||||
|   m_isRightToLeft: 0 | ||||
|   m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} | ||||
|   m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} | ||||
|   m_fontSharedMaterials: [] | ||||
|   m_fontMaterial: {fileID: 0} | ||||
|   m_fontMaterials: [] | ||||
|   m_fontColor32: | ||||
|     serializedVersion: 2 | ||||
|     rgba: 4294967295 | ||||
|   m_fontColor: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_enableVertexGradient: 0 | ||||
|   m_colorMode: 3 | ||||
|   m_fontColorGradient: | ||||
|     topLeft: {r: 1, g: 1, b: 1, a: 1} | ||||
|     topRight: {r: 1, g: 1, b: 1, a: 1} | ||||
|     bottomLeft: {r: 1, g: 1, b: 1, a: 1} | ||||
|     bottomRight: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_fontColorGradientPreset: {fileID: 0} | ||||
|   m_spriteAsset: {fileID: 0} | ||||
|   m_tintAllSprites: 0 | ||||
|   m_StyleSheet: {fileID: 0} | ||||
|   m_TextStyleHashCode: -1183493901 | ||||
|   m_overrideHtmlColors: 0 | ||||
|   m_faceColor: | ||||
|     serializedVersion: 2 | ||||
|     rgba: 4294967295 | ||||
|   m_fontSize: 16 | ||||
|   m_fontSizeBase: 16 | ||||
|   m_fontWeight: 400 | ||||
|   m_enableAutoSizing: 0 | ||||
|   m_fontSizeMin: 18 | ||||
|   m_fontSizeMax: 72 | ||||
|   m_fontStyle: 0 | ||||
|   m_HorizontalAlignment: 1 | ||||
|   m_VerticalAlignment: 512 | ||||
|   m_textAlignment: 65535 | ||||
|   m_characterSpacing: 0 | ||||
|   m_wordSpacing: 0 | ||||
|   m_lineSpacing: 0 | ||||
|   m_lineSpacingMax: 0 | ||||
|   m_paragraphSpacing: 0 | ||||
|   m_charWidthMaxAdj: 0 | ||||
|   m_enableWordWrapping: 1 | ||||
|   m_wordWrappingRatios: 0.4 | ||||
|   m_overflowMode: 0 | ||||
|   m_linkedTextComponent: {fileID: 0} | ||||
|   parentLinkedComponent: {fileID: 0} | ||||
|   m_enableKerning: 1 | ||||
|   m_enableExtraPadding: 0 | ||||
|   checkPaddingRequired: 0 | ||||
|   m_isRichText: 1 | ||||
|   m_parseCtrlCharacters: 1 | ||||
|   m_isOrthographic: 1 | ||||
|   m_isCullingEnabled: 0 | ||||
|   m_horizontalMapping: 0 | ||||
|   m_verticalMapping: 0 | ||||
|   m_uvLineOffset: 0 | ||||
|   m_geometrySortingOrder: 0 | ||||
|   m_IsTextObjectScaleStatic: 0 | ||||
|   m_VertexBufferAutoSizeReduction: 0 | ||||
|   m_useMaxVisibleDescender: 1 | ||||
|   m_pageToDisplay: 1 | ||||
|   m_margin: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_isUsingLegacyAnimationComponent: 0 | ||||
|   m_isVolumetricText: 0 | ||||
|   m_hasFontAssetChanged: 0 | ||||
|   m_baseMaterial: {fileID: 0} | ||||
|   m_maskOffset: {x: 0, y: 0, z: 0, w: 0} | ||||
							
								
								
									
										7
									
								
								Assets/KF3/Prefabs/UI/MorphToggle.prefab.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/KF3/Prefabs/UI/MorphToggle.prefab.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: a1970a34f4ac9fc4cb6c3ad8678bcdf8 | ||||
| PrefabImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										873
									
								
								Assets/KF3/Prefabs/UI/MorphToggleSlider.prefab
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										873
									
								
								Assets/KF3/Prefabs/UI/MorphToggleSlider.prefab
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,873 @@ | ||||
| %YAML 1.1 | ||||
| %TAG !u! tag:unity3d.com,2011: | ||||
| --- !u!1 &1451225421186468728 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 5101148945640598805} | ||||
|   - component: {fileID: 1160409419726520999} | ||||
|   m_Layer: 5 | ||||
|   m_Name: MorphSlider | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &5101148945640598805 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 1451225421186468728} | ||||
|   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: 5882853902430253298} | ||||
|   - {fileID: 5203495626939517929} | ||||
|   - {fileID: 4308357552645940838} | ||||
|   m_Father: {fileID: 6787305365772754371} | ||||
|   m_RootOrder: 1 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0} | ||||
|   m_AnchorMax: {x: 1, y: 0} | ||||
|   m_AnchoredPosition: {x: 0.000061035156, y: 0.000030517578} | ||||
|   m_SizeDelta: {x: -10, y: 20} | ||||
|   m_Pivot: {x: 0.5, y: 0} | ||||
| --- !u!114 &1160409419726520999 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 1451225421186468728} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   m_Navigation: | ||||
|     m_Mode: 3 | ||||
|     m_WrapAround: 0 | ||||
|     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: 3984808659029867453} | ||||
|   m_FillRect: {fileID: 7434744616954175478} | ||||
|   m_HandleRect: {fileID: 6096567429521374474} | ||||
|   m_Direction: 0 | ||||
|   m_MinValue: 0 | ||||
|   m_MaxValue: 100 | ||||
|   m_WholeNumbers: 1 | ||||
|   m_Value: 0 | ||||
|   m_OnValueChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
| --- !u!1 &2023615170869959625 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 5203495626939517929} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Fill Area | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &5203495626939517929 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2023615170869959625} | ||||
|   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: 7434744616954175478} | ||||
|   m_Father: {fileID: 5101148945640598805} | ||||
|   m_RootOrder: 1 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0.25} | ||||
|   m_AnchorMax: {x: 1, y: 0.75} | ||||
|   m_AnchoredPosition: {x: -5, y: 0} | ||||
|   m_SizeDelta: {x: -20, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!1 &2471763352390373912 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 4308357552645940838} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Handle Slide Area | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &4308357552645940838 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2471763352390373912} | ||||
|   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: 6096567429521374474} | ||||
|   m_Father: {fileID: 5101148945640598805} | ||||
|   m_RootOrder: 2 | ||||
|   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: -20, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!1 &2510049255526463552 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 6096567429521374474} | ||||
|   - component: {fileID: 4742402777936722718} | ||||
|   - component: {fileID: 3984808659029867453} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Handle | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &6096567429521374474 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2510049255526463552} | ||||
|   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: 4308357552645940838} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0} | ||||
|   m_AnchorMax: {x: 0, y: 0} | ||||
|   m_AnchoredPosition: {x: 0, y: 0} | ||||
|   m_SizeDelta: {x: 20, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &4742402777936722718 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2510049255526463552} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &3984808659029867453 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 2510049255526463552} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} | ||||
|   m_Type: 0 | ||||
|   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!1 &3594065669119621667 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 6787305365772754371} | ||||
|   - component: {fileID: 5212221834949504815} | ||||
|   - component: {fileID: 7351176722807286657} | ||||
|   - component: {fileID: 1764505660656797435} | ||||
|   m_Layer: 5 | ||||
|   m_Name: MorphToggleSlider | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &6787305365772754371 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   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: 1283946357276694583} | ||||
|   - {fileID: 5101148945640598805} | ||||
|   - {fileID: 2082427350901896704} | ||||
|   m_Father: {fileID: 0} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 1} | ||||
|   m_AnchorMax: {x: 0, y: 1} | ||||
|   m_AnchoredPosition: {x: 983, y: -294} | ||||
|   m_SizeDelta: {x: 170, y: 36} | ||||
|   m_Pivot: {x: 0, y: 1} | ||||
| --- !u!222 &5212221834949504815 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &7351176722807286657 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   m_Enabled: 0 | ||||
|   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: 0.392} | ||||
|   m_RaycastTarget: 1 | ||||
|   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 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!114 &1764505660656797435 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 3594065669119621667} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: ce70097e989567b4c8cdc841bea38e7c, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   Slider: {fileID: 1160409419726520999} | ||||
|   ToggleCallbacks: {fileID: 6650061251048089259} | ||||
|   Text: {fileID: 3808922627261925310} | ||||
|   Toggle: {fileID: 6072093624729148347} | ||||
| --- !u!1 &5100599950166842026 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 2082427350901896704} | ||||
|   - component: {fileID: 6072093624729148347} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Toggle | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &2082427350901896704 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 5100599950166842026} | ||||
|   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: 1486240385386209732} | ||||
|   m_Father: {fileID: 6787305365772754371} | ||||
|   m_RootOrder: 2 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 1} | ||||
|   m_AnchorMax: {x: 0, y: 1} | ||||
|   m_AnchoredPosition: {x: 5, y: -1.5} | ||||
|   m_SizeDelta: {x: 16, y: 16} | ||||
|   m_Pivot: {x: 0, y: 1} | ||||
| --- !u!114 &6072093624729148347 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 5100599950166842026} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   m_Navigation: | ||||
|     m_Mode: 3 | ||||
|     m_WrapAround: 0 | ||||
|     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: 395059011922667607} | ||||
|   toggleTransition: 1 | ||||
|   graphic: {fileID: 955629858079808744} | ||||
|   m_Group: {fileID: 0} | ||||
|   onValueChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_IsOn: 1 | ||||
| --- !u!1 &6739384456699907057 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 7434744616954175478} | ||||
|   - component: {fileID: 956272652380745244} | ||||
|   - component: {fileID: 6569251248387748135} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Fill | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &7434744616954175478 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6739384456699907057} | ||||
|   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: 5203495626939517929} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0} | ||||
|   m_AnchorMax: {x: 0, y: 0} | ||||
|   m_AnchoredPosition: {x: 0, y: 0} | ||||
|   m_SizeDelta: {x: 10, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &956272652380745244 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6739384456699907057} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &6569251248387748135 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 6739384456699907057} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   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!1 &8095447207275656126 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 1283946357276694583} | ||||
|   - component: {fileID: 9132769058287262584} | ||||
|   - component: {fileID: 3808922627261925310} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Text (TMP) | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &1283946357276694583 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8095447207275656126} | ||||
|   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: 6787305365772754371} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 1} | ||||
|   m_AnchorMax: {x: 1, y: 1} | ||||
|   m_AnchoredPosition: {x: 15.000001, y: -0.000030517578} | ||||
|   m_SizeDelta: {x: -29.999998, y: 20} | ||||
|   m_Pivot: {x: 0.5, y: 1} | ||||
| --- !u!222 &9132769058287262584 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8095447207275656126} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &3808922627261925310 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8095447207275656126} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   m_Material: {fileID: 0} | ||||
|   m_Color: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_RaycastTarget: 1 | ||||
|   m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_text: New Text | ||||
|   m_isRightToLeft: 0 | ||||
|   m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} | ||||
|   m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} | ||||
|   m_fontSharedMaterials: [] | ||||
|   m_fontMaterial: {fileID: 0} | ||||
|   m_fontMaterials: [] | ||||
|   m_fontColor32: | ||||
|     serializedVersion: 2 | ||||
|     rgba: 4294967295 | ||||
|   m_fontColor: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_enableVertexGradient: 0 | ||||
|   m_colorMode: 3 | ||||
|   m_fontColorGradient: | ||||
|     topLeft: {r: 1, g: 1, b: 1, a: 1} | ||||
|     topRight: {r: 1, g: 1, b: 1, a: 1} | ||||
|     bottomLeft: {r: 1, g: 1, b: 1, a: 1} | ||||
|     bottomRight: {r: 1, g: 1, b: 1, a: 1} | ||||
|   m_fontColorGradientPreset: {fileID: 0} | ||||
|   m_spriteAsset: {fileID: 0} | ||||
|   m_tintAllSprites: 0 | ||||
|   m_StyleSheet: {fileID: 0} | ||||
|   m_TextStyleHashCode: -1183493901 | ||||
|   m_overrideHtmlColors: 0 | ||||
|   m_faceColor: | ||||
|     serializedVersion: 2 | ||||
|     rgba: 4294967295 | ||||
|   m_fontSize: 16 | ||||
|   m_fontSizeBase: 16 | ||||
|   m_fontWeight: 400 | ||||
|   m_enableAutoSizing: 0 | ||||
|   m_fontSizeMin: 18 | ||||
|   m_fontSizeMax: 72 | ||||
|   m_fontStyle: 0 | ||||
|   m_HorizontalAlignment: 1 | ||||
|   m_VerticalAlignment: 256 | ||||
|   m_textAlignment: 65535 | ||||
|   m_characterSpacing: 0 | ||||
|   m_wordSpacing: 0 | ||||
|   m_lineSpacing: 0 | ||||
|   m_lineSpacingMax: 0 | ||||
|   m_paragraphSpacing: 0 | ||||
|   m_charWidthMaxAdj: 0 | ||||
|   m_enableWordWrapping: 1 | ||||
|   m_wordWrappingRatios: 0.4 | ||||
|   m_overflowMode: 0 | ||||
|   m_linkedTextComponent: {fileID: 0} | ||||
|   parentLinkedComponent: {fileID: 0} | ||||
|   m_enableKerning: 1 | ||||
|   m_enableExtraPadding: 0 | ||||
|   checkPaddingRequired: 0 | ||||
|   m_isRichText: 1 | ||||
|   m_parseCtrlCharacters: 1 | ||||
|   m_isOrthographic: 1 | ||||
|   m_isCullingEnabled: 0 | ||||
|   m_horizontalMapping: 0 | ||||
|   m_verticalMapping: 0 | ||||
|   m_uvLineOffset: 0 | ||||
|   m_geometrySortingOrder: 0 | ||||
|   m_IsTextObjectScaleStatic: 0 | ||||
|   m_VertexBufferAutoSizeReduction: 0 | ||||
|   m_useMaxVisibleDescender: 1 | ||||
|   m_pageToDisplay: 1 | ||||
|   m_margin: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_isUsingLegacyAnimationComponent: 0 | ||||
|   m_isVolumetricText: 0 | ||||
|   m_hasFontAssetChanged: 0 | ||||
|   m_baseMaterial: {fileID: 0} | ||||
|   m_maskOffset: {x: 0, y: 0, z: 0, w: 0} | ||||
| --- !u!1 &8136949952947563388 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 5882853902430253298} | ||||
|   - component: {fileID: 8404216737247336084} | ||||
|   - component: {fileID: 6857429999625137368} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Background | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &5882853902430253298 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8136949952947563388} | ||||
|   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: 5101148945640598805} | ||||
|   m_RootOrder: 0 | ||||
|   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||||
|   m_AnchorMin: {x: 0, y: 0.25} | ||||
|   m_AnchorMax: {x: 1, y: 0.75} | ||||
|   m_AnchoredPosition: {x: 0, y: 0} | ||||
|   m_SizeDelta: {x: 0, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &8404216737247336084 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8136949952947563388} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &6857429999625137368 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8136949952947563388} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 10907, 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!1 &8780337301073652623 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 4260789979014223907} | ||||
|   - component: {fileID: 5491607378222969123} | ||||
|   - component: {fileID: 955629858079808744} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Checkmark | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &4260789979014223907 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8780337301073652623} | ||||
|   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: 1486240385386209732} | ||||
|   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.000015258789, y: 0} | ||||
|   m_SizeDelta: {x: 0, y: 0} | ||||
|   m_Pivot: {x: 0.5, y: 0.5} | ||||
| --- !u!222 &5491607378222969123 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8780337301073652623} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &955629858079808744 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8780337301073652623} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   m_Maskable: 1 | ||||
|   m_OnCullStateChanged: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} | ||||
|   m_Type: 0 | ||||
|   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!1 &8849731523621724651 | ||||
| GameObject: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   serializedVersion: 6 | ||||
|   m_Component: | ||||
|   - component: {fileID: 1486240385386209732} | ||||
|   - component: {fileID: 6863922223278217974} | ||||
|   - component: {fileID: 395059011922667607} | ||||
|   - component: {fileID: 6650061251048089259} | ||||
|   m_Layer: 5 | ||||
|   m_Name: Background | ||||
|   m_TagString: Untagged | ||||
|   m_Icon: {fileID: 0} | ||||
|   m_NavMeshLayer: 0 | ||||
|   m_StaticEditorFlags: 0 | ||||
|   m_IsActive: 1 | ||||
| --- !u!224 &1486240385386209732 | ||||
| RectTransform: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8849731523621724651} | ||||
|   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: 4260789979014223907} | ||||
|   m_Father: {fileID: 2082427350901896704} | ||||
|   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!222 &6863922223278217974 | ||||
| CanvasRenderer: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8849731523621724651} | ||||
|   m_CullTransparentMesh: 1 | ||||
| --- !u!114 &395059011922667607 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8849731523621724651} | ||||
|   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_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} | ||||
|   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!114 &6650061251048089259 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_GameObject: {fileID: 8849731523621724651} | ||||
|   m_Enabled: 1 | ||||
|   m_EditorHideFlags: 0 | ||||
|   m_Script: {fileID: 11500000, guid: 902f33e1b15fa0d40b8eefd09e3ab28f, type: 3} | ||||
|   m_Name:  | ||||
|   m_EditorClassIdentifier:  | ||||
|   MouseHover: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
|   MouseHoverEnd: | ||||
|     m_PersistentCalls: | ||||
|       m_Calls: [] | ||||
							
								
								
									
										7
									
								
								Assets/KF3/Prefabs/UI/MorphToggleSlider.prefab.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/KF3/Prefabs/UI/MorphToggleSlider.prefab.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: d14a29596b555f3458423c78e0082679 | ||||
| PrefabImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										4014
									
								
								Assets/KF3/Prefabs/UI/SceneSettings.prefab
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4014
									
								
								Assets/KF3/Prefabs/UI/SceneSettings.prefab
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										7
									
								
								Assets/KF3/Prefabs/UI/SceneSettings.prefab.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/KF3/Prefabs/UI/SceneSettings.prefab.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 581741c85ee2b1d43b73c88a0364f8c5 | ||||
| PrefabImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										1656
									
								
								Assets/KF3/Prefabs/UI/StaticSettings.prefab
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1656
									
								
								Assets/KF3/Prefabs/UI/StaticSettings.prefab
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										7
									
								
								Assets/KF3/Prefabs/UI/StaticSettings.prefab.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Assets/KF3/Prefabs/UI/StaticSettings.prefab.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 0eb004b3d1c3a5642ae606e60c5294e4 | ||||
| PrefabImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										8
									
								
								Assets/KF3/Scripts.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Assets/KF3/Scripts.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 038ba5aed73069e4d88ea650fb1c0e7e | ||||
| folderAsset: yes | ||||
| DefaultImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										13
									
								
								Assets/KF3/Scripts/AdditionalResources.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Assets/KF3/Scripts/AdditionalResources.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| namespace KF3 | ||||
| { | ||||
|     public class AdditionalResources : SharedResources | ||||
|     { | ||||
|         public UIKF3MorphSlider Pfb_KF3MorphSliderToggle; | ||||
|         public UIKF3CharacterPanel Pfb_KF3CharacterPanel; | ||||
|         public UIKF3StaticSettings Pfb_KF3StaticSettings; | ||||
|         public UIKF3SceneSettings Pfb_KF3SceneSettings; | ||||
|         public UIKF3MorphSlider Pfb_KF3MorphSlider; | ||||
|         public UIKF3MorphSlider Pfb_KF3MorphToggle; | ||||
|         public UIKF3MorphPanel Pfb_KF3MorphPanel; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/AdditionalResources.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/AdditionalResources.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 3eddd5732ddb1bd4e884314ec626f739 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										292
									
								
								Assets/KF3/Scripts/CharaModelReferencer.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										292
									
								
								Assets/KF3/Scripts/CharaModelReferencer.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,292 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class CharaModelReferencer : MonoBehaviour | ||||
| { | ||||
|     private void Awake() | ||||
| 	{ | ||||
| 		root = base.transform.Find("root"); | ||||
| 		if(root != null) | ||||
| 		{ | ||||
| 			boneList.Clear(); | ||||
| 			MakeBoneList(root); | ||||
| 		} | ||||
|     } | ||||
|  | ||||
|     private void Update() | ||||
| 	{ | ||||
| 		UpdateOsage(); | ||||
| 	} | ||||
|  | ||||
| 	private void LateUpdate() | ||||
|     { | ||||
| 		Transform left = boneList.FirstOrDefault(b => b.name == "j_thigh_l"); | ||||
| 		Transform right = boneList.FirstOrDefault(b => b.name == "j_thigh_r"); | ||||
| 		LateUpdateOsage(left, right); | ||||
| 	} | ||||
|  | ||||
|     public void JoinReferenceParam() | ||||
| 	{ | ||||
| 		if (this.refAnimationObj == null) return; | ||||
|  | ||||
| 		SimpleAnimation component = this.root.GetComponent<SimpleAnimation>(); | ||||
|  | ||||
| 		if (component == null) return; | ||||
|  | ||||
| 		component.clip = null; | ||||
|  | ||||
| 		for(int i = component.GetStates().Count() - 1; i >= 0; i--) | ||||
| 		{ | ||||
| 			component.RemoveState(component.GetStates().ToList()[i].name); | ||||
|         } | ||||
|  | ||||
| 		foreach (CharaModelReferencer.RefAnime refAnime in this.refAnimationObj.GetComponent<CharaModelReferencer>().prefabAnimeList) | ||||
| 		{ | ||||
| 			if (refAnime.clip != null) | ||||
| 			{ | ||||
| 				component.AddState(refAnime.clip, refAnime.name); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		this.rootPos = (this.basePos = this.root.localPosition); | ||||
| 		if (this.refAnimationObj.GetComponent<CharaModelReferencer>().scaleParamList.Count > 0) | ||||
| 		{ | ||||
| 			this.root.localPosition = (this.rootPos = new Vector3(this.root.localPosition.x, this.refAnimationObj.GetComponent<CharaModelReferencer>().rootPosY, this.root.localPosition.z)); | ||||
| 		} | ||||
|  | ||||
| 		component.gameObject.SetActive(false); | ||||
|  | ||||
| 		setScaleOne(); | ||||
|  | ||||
| 		foreach (Transform transform in this.boneList) | ||||
| 		{ | ||||
| 			this.setOsage(transform); | ||||
| 			this.setScale(transform); | ||||
| 		} | ||||
|  | ||||
| 		component.gameObject.SetActive(true); | ||||
| 	} | ||||
|  | ||||
|     private void MakeBoneList(Transform bone) | ||||
| 	{ | ||||
| 		if (bone.GetComponent<CharaModelReferencer>() != null) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| 		if (bone.name.IndexOf("j_") == 0 || bone.name == "root" || bone.name == "pelvis") | ||||
| 		{ | ||||
| 			this.boneList.Add(bone); | ||||
| 		} | ||||
| 		foreach (object obj in bone) | ||||
| 		{ | ||||
| 			Transform bone2 = (Transform)obj; | ||||
| 			this.MakeBoneList(bone2); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	private void setOsage(Transform bone) | ||||
| 	{ | ||||
| 		Osage osage = bone.GetComponent<Osage>(); | ||||
| 		if (osage == null && bone.name.IndexOf("j_osg") == 0) | ||||
| 		{ | ||||
| 			osage = bone.gameObject.AddComponent<Osage>(); | ||||
| 		} | ||||
| 		CharaModelReferencer.OsageParam osageParam = this.refAnimationObj.GetComponent<CharaModelReferencer>().osageParamList.Find((CharaModelReferencer.OsageParam itm) => itm.boneName == bone.name); | ||||
| 		if (osageParam != null) | ||||
| 		{ | ||||
| 			if (osage == null) | ||||
| 			{ | ||||
| 				osage = bone.gameObject.AddComponent<Osage>(); | ||||
| 			} | ||||
| 			osage.boneAxis = osageParam.boneAxis; | ||||
| 			osage.stiffnessForce = osageParam.stiffnessForce; | ||||
| 			osage.dragForce = osageParam.dragForce; | ||||
| 			osage.springForce = osageParam.springForce; | ||||
| 		} | ||||
| 		else if (osage != null && bone.name.IndexOf("j_osg") != 0) | ||||
| 		{ | ||||
|             UnityEngine.Object.Destroy(osage); | ||||
| 			osage = null; | ||||
| 		} | ||||
| 		if (osage != null) | ||||
| 		{ | ||||
| 			this.osageList.Add(osage); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	private void setScale(Transform bone) | ||||
| 	{ | ||||
| 		CharaModelReferencer.ScaleParam scaleParam = this.refAnimationObj.GetComponent<CharaModelReferencer>().scaleParamList.Find((CharaModelReferencer.ScaleParam itm) => itm.boneName == bone.name); | ||||
| 		if (scaleParam != null) | ||||
| 		{ | ||||
| 			bone.localScale = scaleParam.boneScale; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	public void setScaleOne() | ||||
| 	{ | ||||
| 		if (this.refAnimationObj == null) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| 		foreach (Transform transform in this.boneList) | ||||
| 		{ | ||||
| 			transform.localScale = Vector3.one; | ||||
| 		} | ||||
| 		this.root.localPosition = (this.rootPos = Vector3.zero); | ||||
| 	} | ||||
|  | ||||
| 	public void UpdateOsage() | ||||
| 	{ | ||||
| 		if (this.refAnimationObj == null) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| 		foreach (Osage osage in this.osageList) | ||||
| 		{ | ||||
| 			osage.UpdateOsage(); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	public void LateUpdateOsage(Transform thighL, Transform thighR) | ||||
| 	{ | ||||
| 		if (this.refAnimationObj == null) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| 		foreach (Osage osage in this.osageList) | ||||
| 		{ | ||||
| 			osage.LateUpdateOsage(thighL, thighR); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	public void SetRootPos(bool reset) | ||||
| 	{ | ||||
| 		this.root.localPosition = (reset ? this.basePos : this.rootPos); | ||||
| 	} | ||||
|  | ||||
| 	public void ResetOsage() | ||||
| 	{ | ||||
| 		if (this.refAnimationObj == null) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| 		foreach (Osage osage in this.osageList) | ||||
| 		{ | ||||
| 			osage.Reset(); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	public GameObject refAnimationObj; | ||||
|  | ||||
| 	private Transform root; | ||||
|  | ||||
| 	public List<Transform> boneList = new List<Transform>(); | ||||
|  | ||||
| 	private List<Osage> osageList = new List<Osage>(); | ||||
|  | ||||
| 	private Vector3 basePos = Vector3.zero; | ||||
|  | ||||
| 	private Vector3 rootPos = Vector3.zero; | ||||
|  | ||||
| 	public CharaMotionDefine.MotionPersonalityType motionPersonalityType; | ||||
|  | ||||
| 	public List<CharaModelReferencer.RefAnime> prefabAnimeList = new List<CharaModelReferencer.RefAnime>(); | ||||
|  | ||||
| 	public List<CharaModelReferencer.OsageParam> osageParamList = new List<CharaModelReferencer.OsageParam>(); | ||||
|  | ||||
| 	public float rootPosY; | ||||
|  | ||||
| 	public List<CharaModelReferencer.ScaleParam> scaleParamList = new List<CharaModelReferencer.ScaleParam>(); | ||||
|  | ||||
| 	public Color eyeColor = new Color(0f, 0f, 0f, 0f); | ||||
|  | ||||
| 	public string tailNodeName = ""; | ||||
|  | ||||
| 	public string earNodeName = ""; | ||||
|  | ||||
| 	public string variantCopyPrefabName = ""; | ||||
|  | ||||
| 	public bool ussVariantCopyPrefabVoice; | ||||
|  | ||||
| 	[Serializable] | ||||
| 	public class RefAnime | ||||
| 	{ | ||||
| 		// Token: 0x06004018 RID: 16408 RVA: 0x001C7E0F File Offset: 0x001C600F | ||||
| 		public RefAnime() | ||||
| 		{ | ||||
| 		} | ||||
|  | ||||
| 		// Token: 0x06004019 RID: 16409 RVA: 0x001C7E30 File Offset: 0x001C6030 | ||||
| 		public RefAnime(string nam, AnimationClip clp, string se, int eb, int ef, int ea, int tb, int tf, int ta) | ||||
| 		{ | ||||
| 			this.name = nam; | ||||
| 			this.clip = clp; | ||||
| 			this.seName = se; | ||||
| 			this.earBefore = eb; | ||||
| 			this.earFrame = ef; | ||||
| 			this.earAfter = ea; | ||||
| 			this.tailBefore = tb; | ||||
| 			this.tailFrame = tf; | ||||
| 			this.tailAfter = ta; | ||||
| 		} | ||||
|  | ||||
| 		// Token: 0x0400481C RID: 18460 | ||||
| 		public string name = ""; | ||||
|  | ||||
| 		// Token: 0x0400481D RID: 18461 | ||||
| 		public AnimationClip clip; | ||||
|  | ||||
| 		// Token: 0x0400481E RID: 18462 | ||||
| 		public string seName = ""; | ||||
|  | ||||
| 		// Token: 0x0400481F RID: 18463 | ||||
| 		public int earBefore; | ||||
|  | ||||
| 		// Token: 0x04004820 RID: 18464 | ||||
| 		public int earFrame; | ||||
|  | ||||
| 		// Token: 0x04004821 RID: 18465 | ||||
| 		public int earAfter; | ||||
|  | ||||
| 		// Token: 0x04004822 RID: 18466 | ||||
| 		public int tailBefore; | ||||
|  | ||||
| 		// Token: 0x04004823 RID: 18467 | ||||
| 		public int tailFrame; | ||||
|  | ||||
| 		// Token: 0x04004824 RID: 18468 | ||||
| 		public int tailAfter; | ||||
| 	} | ||||
|  | ||||
| 	[Serializable] | ||||
| 	public class OsageParam | ||||
| 	{ | ||||
| 		// Token: 0x04004825 RID: 18469 | ||||
| 		public string boneName; | ||||
|  | ||||
| 		// Token: 0x04004826 RID: 18470 | ||||
| 		public Vector3 boneAxis; | ||||
|  | ||||
| 		// Token: 0x04004827 RID: 18471 | ||||
| 		public float stiffnessForce; | ||||
|  | ||||
| 		// Token: 0x04004828 RID: 18472 | ||||
| 		public float dragForce; | ||||
|  | ||||
| 		// Token: 0x04004829 RID: 18473 | ||||
| 		public Vector3 springForce; | ||||
| 	} | ||||
|  | ||||
| 	[Serializable] | ||||
| 	public class ScaleParam | ||||
| 	{ | ||||
| 		// Token: 0x0400482A RID: 18474 | ||||
| 		public string boneName; | ||||
|  | ||||
| 		// Token: 0x0400482B RID: 18475 | ||||
| 		public Vector3 boneScale; | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/CharaModelReferencer.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/CharaModelReferencer.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: d3c24f6a6f3ca1b48a2169cbfca871f8 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										1097
									
								
								Assets/KF3/Scripts/CharaMotionDefine.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1097
									
								
								Assets/KF3/Scripts/CharaMotionDefine.cs
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/CharaMotionDefine.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/CharaMotionDefine.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: ec813cdf8e05fbb489716dadac046141 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										8
									
								
								Assets/KF3/Scripts/Containers.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Assets/KF3/Scripts/Containers.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 1ca9226664748b2429436d99a7bb4d1c | ||||
| folderAsset: yes | ||||
| DefaultImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										168
									
								
								Assets/KF3/Scripts/Containers/CharacterKeyframeData.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										168
									
								
								Assets/KF3/Scripts/Containers/CharacterKeyframeData.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,168 @@ | ||||
| using SerializableTypes; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
| using static KF3CharacterContainerSerializable; | ||||
|  | ||||
| namespace KF3.Containers | ||||
| { | ||||
|     [System.Serializable] | ||||
|     public class CharacterKeyframeData : KeyframeData | ||||
|     { | ||||
|         public BoneList[] Bones = new BoneList[0]; | ||||
|         public MorphHelper[] Morphs = new MorphHelper[0]; | ||||
|         public MorphHelper[] Renderers = new MorphHelper[0]; | ||||
|         public bool | ||||
|             EyesLocked, | ||||
|             PhysicsEnabled, | ||||
|             IKEnabled; | ||||
|         public SVector3 LeftEyeRotation, RightEyeRotation; | ||||
|         public SVector3 EyeTarget; | ||||
|         public float LookAtStrength; | ||||
|         public string CurrentAnimation; | ||||
|  | ||||
|         public CharacterKeyframeData() { } | ||||
|  | ||||
|         public CharacterKeyframeData(KF3CharacterContainer container) | ||||
|         { | ||||
|             this.Root = new SerializableTransform(container.transform); | ||||
|             this.CurrentAnimation = container.CurrentAnimation; | ||||
|             this.IKEnabled = container.IKEnabled; | ||||
|             this.PhysicsEnabled = container.PhysicsEnabled; | ||||
|             if (container as KF3CeruleanContainer != null) | ||||
|             { | ||||
|                 var bones = new List<BoneList> | ||||
|             { | ||||
|                 new BoneList() | ||||
|                 { | ||||
|                     Name = "Body", | ||||
|                     Bones = container.Body.boneList.Select(b => new SerializableBone(b)).ToArray() | ||||
|                 } | ||||
|             }; | ||||
|                 this.Bones = bones.ToArray(); | ||||
|                 this.Renderers = container.Renderers.Select(r => new MorphHelper("", GetRendererName(container, r), 0, r.enabled)).ToArray(); | ||||
|             } | ||||
|             else if (container as KF3FriendContainer != null) | ||||
|             { | ||||
|                 var bones = new List<BoneList> | ||||
|             { | ||||
|                 new BoneList() | ||||
|                 { | ||||
|                     Name = "Body", | ||||
|                     Bones = container.Body != null ? container.Body.boneList.Select(b => new SerializableBone(b)).ToArray() : new SerializableBone[0] | ||||
|                 } | ||||
|             }; | ||||
|                 var container1 = (KF3FriendContainer)container; | ||||
|                 bones.Add(new BoneList() | ||||
|                 { | ||||
|                     Name = "Ears", | ||||
|                     Bones = container1.Ears != null ? container1.Ears.boneList.Select(b => new SerializableBone(b)).ToArray() : new SerializableBone[0] | ||||
|                 }); | ||||
|                 bones.Add(new BoneList() | ||||
|                 { | ||||
|                     Name = "EarsAlt", | ||||
|                     Bones = container1.EarsAlt != null ? container1.EarsAlt.boneList.Select(b => new SerializableBone(b)).ToArray() : new SerializableBone[0] | ||||
|                 }); | ||||
|                 bones.Add(new BoneList() | ||||
|                 { | ||||
|                     Name = "Tail", | ||||
|                     Bones = container1.Tail != null ? container1.Tail.boneList.Select(b => new SerializableBone(b)).ToArray() : new SerializableBone[0] | ||||
|                 }); | ||||
|                 bones.Add(new BoneList() | ||||
|                 { | ||||
|                     Name = "TailAlt", | ||||
|                     Bones = container1.TailAlt != null ? container1.TailAlt.boneList.Select(b => new SerializableBone(b)).ToArray() : new SerializableBone[0] | ||||
|                 }); | ||||
|                 var extraBones = new List<SerializableBone>(); | ||||
|                 foreach (var ik in container1.GetComponentsInChildren<InverseKinematics>()) | ||||
|                 { | ||||
|                     extraBones.Add(new SerializableBone(ik.target)); | ||||
|                     extraBones.Add(new SerializableBone(ik.elbow)); | ||||
|                 } | ||||
|                 bones.Add(new BoneList() | ||||
|                 { | ||||
|                     Name = "Extra", | ||||
|                     Bones = extraBones.ToArray() | ||||
|                 }); | ||||
|                 this.Bones = bones.ToArray(); | ||||
|                 this.EyesLocked = container1.EyesLocked; | ||||
|                 this.LeftEyeRotation = container1.LeftEyeRotation.eulerAngles; | ||||
|                 this.RightEyeRotation = container1.RightEyeRotation.eulerAngles; | ||||
|                 this.EyeTarget = container1.EyeTarget.transform.localPosition; | ||||
|                 this.LookAtStrength = container1.LookAtStrength; | ||||
|  | ||||
|                 var morphs = new List<MorphHelper>(); | ||||
|                 foreach (var mesh in container1.Morphs) | ||||
|                 { | ||||
|                     foreach (MorphHelper morph in mesh.Value) | ||||
|                     { | ||||
|                         morphs.Add(new MorphHelper(morph.ParentName, morph.Name, morph.Strength, morph.Value)); | ||||
|                     } | ||||
|                 } | ||||
|                 this.Morphs = morphs.ToArray(); | ||||
|                 this.Renderers = container1.Renderers.Select(r => new MorphHelper("", GetRendererName(container1, r), 0, r.enabled)).ToArray(); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 Error.Log("Sum ting wong", UnityEngine.Color.red); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public override KeyframeData Clone() | ||||
|         { | ||||
|             var keyframe = new CharacterKeyframeData(); | ||||
|             keyframe.Root = new SerializableTransform(this.Root); | ||||
|             keyframe.Bones = this.Bones.Select(b => new BoneList() { Name = b.Name, Bones = b.Bones.Select(b1 => new SerializableBone(b1)).ToArray() }).ToArray(); | ||||
|             keyframe.EyesLocked = this.EyesLocked; | ||||
|             keyframe.IKEnabled = this.IKEnabled; | ||||
|             keyframe.PhysicsEnabled = this.PhysicsEnabled; | ||||
|             keyframe.LeftEyeRotation = this.LeftEyeRotation; | ||||
|             keyframe.RightEyeRotation = this.RightEyeRotation; | ||||
|             keyframe.EyeTarget = this.EyeTarget; | ||||
|             keyframe.LookAtStrength = this.LookAtStrength; | ||||
|             keyframe.CurrentAnimation = this.CurrentAnimation; | ||||
|             var morphs = new List<MorphHelper>(); | ||||
|             var renderers = new List<MorphHelper>(); | ||||
|             foreach (var morph in this.Morphs) | ||||
|             { | ||||
|                 morphs.Add(new MorphHelper(morph.ParentName, morph.Name, morph.Strength, morph.Value)); | ||||
|             } | ||||
|             foreach (var renderer in this.Renderers) | ||||
|             { | ||||
|                 renderers.Add(new MorphHelper(renderer.ParentName, renderer.Name, renderer.Strength, renderer.Value)); | ||||
|             } | ||||
|             keyframe.Morphs = morphs.ToArray(); | ||||
|             keyframe.Renderers = renderers.ToArray(); | ||||
|             return keyframe; | ||||
|         } | ||||
|  | ||||
|         public override KeyframeData Lerp(KeyframeData target, float amount) | ||||
|         { | ||||
|             var target1 = target as CharacterKeyframeData; | ||||
|             if (target1 == null) { Debug.LogError("Error, incompatible type"); return this; } | ||||
|  | ||||
|             var copy = this.Clone() as CharacterKeyframeData; | ||||
|             copy.Root = copy.Root.LerpWith(target1.Root, amount); | ||||
|             copy.EyeTarget = Vector3.Lerp(copy.EyeTarget, target1.EyeTarget, amount); | ||||
|             foreach (var bonelist in copy.Bones) | ||||
|             { | ||||
|                 for (int i = 0; i < bonelist.Bones.Length; i++) | ||||
|                 { | ||||
|                     var bone1 = target1.Bones.FirstOrDefault(b => b.Name == bonelist.Name)?.Bones.FirstOrDefault(b => b.Name == bonelist.Bones[i].Name); | ||||
|                     if (bone1 == null) continue; | ||||
|                     bonelist.Bones[i].Transform = bonelist.Bones[i].Transform.LerpWith(bone1.Transform, amount); | ||||
|                 } | ||||
|             } | ||||
|             if (copy.Morphs != null && target1.Morphs != null) | ||||
|             { | ||||
|                 foreach (var morph in copy.Morphs) | ||||
|                 { | ||||
|                     var targetMorph = target1.Morphs.FirstOrDefault(m => m.ParentName == morph.ParentName && m.Name == morph.Name); | ||||
|                     if (targetMorph == null) continue; | ||||
|                     morph.Strength = Mathf.Lerp(morph.Strength, targetMorph.Strength, amount); | ||||
|                 } | ||||
|             } | ||||
|             return copy; | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Containers/CharacterKeyframeData.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Containers/CharacterKeyframeData.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 8923d4ac35f395b4cadc946757795475 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										162
									
								
								Assets/KF3/Scripts/Containers/KF3CeruleanContainer.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										162
									
								
								Assets/KF3/Scripts/Containers/KF3CeruleanContainer.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,162 @@ | ||||
| using KF3.Containers; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class KF3CeruleanContainer : KF3CharacterContainer | ||||
| { | ||||
|     public UIKF3CharacterPanel CharacterPanel; | ||||
|  | ||||
|     public static IEnumerator CreateAsync(string modelName, string animationSetName, System.Action<KF3CeruleanContainer> callback = null) | ||||
|     { | ||||
|         GameObject go = new GameObject(modelName); | ||||
|         var container = go.AddComponent<KF3CeruleanContainer>(); | ||||
|         yield return container.BuildGeneral(modelName, animationSetName); | ||||
|         UIHandleCerulean.CreateAsChild(container); | ||||
|         Main.SelectObject(container); | ||||
|         container.LoadInProgress = false; | ||||
|         callback?.Invoke(container); | ||||
|     } | ||||
|  | ||||
|     public override void SetAnimationReferences() | ||||
|     { | ||||
|         if (BodyAnimation) | ||||
|         { | ||||
|             BodySimpleAnimation = Body.GetComponentInChildren<SimpleAnimation>(); | ||||
|             if (Main.OverrideClip != null) | ||||
|             { | ||||
|                 foreach (var anim in BodyAnimation.prefabAnimeList) | ||||
|                 { | ||||
|                     anim.clip = Main.OverrideClip; | ||||
|                 } | ||||
|             } | ||||
|             Body.refAnimationObj = BodyAnimation.gameObject; | ||||
|             Body.JoinReferenceParam(); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Error.Log(Color.blue, "Body Animations Missing"); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public override void SetBones() | ||||
|     { | ||||
|         var bones = Body.boneList; | ||||
|         var extraBones = bones.Where(b => b.name.Contains("osg")).ToList(); | ||||
|  | ||||
|         foreach (var bone in bones) | ||||
|         { | ||||
|             if (!bone.gameObject.TryGetComponent(out UIHandle bone1)) | ||||
|             { | ||||
|                 if (bone.GetComponent<Osage>() != null) | ||||
|                 { | ||||
|                     bone1 = UIHandlePhysicsBone.CreateAsChild(this, bone, new List<SerializableBone.BoneTags>() { SerializableBone.BoneTags.Dynamic }).SetColor(Color.cyan).SetName(bone.name); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     bone1 = UIHandleBone.CreateAsChild(this, bone, new List<SerializableBone.BoneTags>()).SetColor(Color.gray).SetName(bone.name); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public override void DoStuff() | ||||
|     { | ||||
|         foreach (Renderer r in GetComponentsInChildren<Renderer>()) | ||||
|         { | ||||
|             Material[] overrideMaterials = new Material[r.materials.Length]; | ||||
|             for (int i = 0; i < r.materials.Length; i++) | ||||
|             { | ||||
|                 overrideMaterials[i] = new Material(Shader.Find("PRD/FriendsShaderV2")); | ||||
|                 if (ModelId >= 40400) | ||||
|                 { | ||||
|                     overrideMaterials[i].SetTexture("_BaseMap", r.materials[i].GetTexture("_BaseMap")); | ||||
|                     overrideMaterials[i].SetTexture("_1st_ShadeMap", r.materials[i].GetTexture("_1st_ShadeMap")); | ||||
|                 } | ||||
|                 else if (ModelId >= 40000) | ||||
|                 { | ||||
|                     overrideMaterials[i].SetTexture("_BaseMap", r.materials[i].mainTexture); | ||||
|                     overrideMaterials[i].SetTexture("_1st_ShadeMap", r.materials[i].mainTexture); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     overrideMaterials[i].SetTexture("_BaseMap", r.materials[i].GetTexture("_BaseMap") as Texture2D); | ||||
|                     overrideMaterials[i].SetTexture("_1st_ShadeMap", r.materials[i].GetTexture("_BaseMap") as Texture2D); | ||||
|                 } | ||||
|             } | ||||
|             r.materials = overrideMaterials; | ||||
|             Renderers.Add(r); | ||||
|         } | ||||
|  | ||||
|         var charaPanel = CharacterPanel = UIKF3CharacterPanel.Create(this); | ||||
|         InstantiatedObjects.Add(charaPanel.gameObject); | ||||
|     } | ||||
|  | ||||
|     public override void PastePose(KeyframeData frame, PoseLoadOptions pasteParams) | ||||
|     { | ||||
|         var bones = frame as CharacterKeyframeData; | ||||
|  | ||||
|         this.PlayBodyAnimation(""); | ||||
|         if (pasteParams.Root) | ||||
|         { | ||||
|             bones.Root.ApplyTo(transform); | ||||
|         } | ||||
|         if (pasteParams.Body) | ||||
|         { | ||||
|             foreach (var bone in this.Body.boneList) | ||||
|             { | ||||
|                 if (pasteParams.Other || bone.GetComponent<Osage>() == null) | ||||
|                     bones.Bones.FirstOrDefault(b => b.Name == "Body").Bones.FirstOrDefault(b => b.Name == bone.name)?.Transform.ApplyTo(bone, pasteParams); | ||||
|             } | ||||
|         } | ||||
|         if (bones.Renderers != null) | ||||
|         { | ||||
|             foreach (var renderer in bones.Renderers) | ||||
|             { | ||||
|                 var rend = this.Renderers.FirstOrDefault(r => KF3CharacterContainerSerializable.GetRendererName(this, r) == renderer.Name); | ||||
|                 if (rend != null) | ||||
|                 { | ||||
|                     rend.enabled = renderer.Value; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public override IEnumerator GetModel(string bodyIdLong, string costumeId) | ||||
|     { | ||||
|         KF3AssetLibrary lib = Main.Assets; | ||||
|         List<KF3AssetBundle> abList = lib.AssetBundles.Where(ab => ab.FileName.StartsWith($"ch_{bodyIdLong}_")).ToList(); | ||||
|         KF3AssetBundle bundle; | ||||
|  | ||||
|         //load body | ||||
|         bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{bodyIdLong}_{costumeId}.prefab"); | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             Body = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     public override IEnumerator GetAnimations(string idLong) | ||||
|     { | ||||
|         KF3AssetLibrary lib = Main.Assets; | ||||
|         KF3AssetBundle bundle; | ||||
|         List<KF3AssetBundle> abList = lib.AssetBundles.Where(ab => ab.FileName.StartsWith($"ch_{idLong}_")).ToList(); | ||||
|  | ||||
|         bundle = lib.CeruleanAnimationSets.FirstOrDefault(ab => ab.FileName == $"ch_{idLong}_a_mot.prefab"); | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             BodyAnimation = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     public override void Select() | ||||
|     { | ||||
|         CharacterPanel.gameObject.SetActive(true); | ||||
|     } | ||||
|  | ||||
|     public override void Deselect() | ||||
|     { | ||||
|         CharacterPanel.gameObject.SetActive(false); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3CeruleanContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3CeruleanContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: c1670e1c9f79d8340a9c745453d0f118 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										265
									
								
								Assets/KF3/Scripts/Containers/KF3CharacterContainer.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										265
									
								
								Assets/KF3/Scripts/Containers/KF3CharacterContainer.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,265 @@ | ||||
| using KF3.Containers; | ||||
| using System.Collections; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class KF3CharacterContainer : KF3ObjectContainer | ||||
| { | ||||
|     protected override System.Type _serializeType => typeof(KF3CharacterContainerSerializable); | ||||
|     protected override System.Type _keyframeType => typeof(CharacterKeyframeData); | ||||
|  | ||||
|  | ||||
|     public bool | ||||
|         BonesVisible = true, | ||||
|         PhysicsEnabled = true, | ||||
|         IKEnabled = true; | ||||
|     public string | ||||
|         CostumeName, | ||||
|         AnimationName; | ||||
|     public CharaModelReferencer | ||||
|         Body, | ||||
|         BodyAnimation; | ||||
|     public SimpleAnimation | ||||
|         BodySimpleAnimation; | ||||
|  | ||||
|     public float AnimationSpeed = 0; | ||||
|     public string CurrentAnimation = ""; | ||||
|  | ||||
|     protected IEnumerator BuildGeneral(string modelName, string animSetName) | ||||
|     { | ||||
|         enabled = false; | ||||
|         string mIdLong = modelName.Split('_', '.')[1]; | ||||
|         string mCostume = modelName.Split('_', '.')[2]; | ||||
|         string aIdLong = animSetName.Split('_', '.')[1]; | ||||
|  | ||||
|         if (LoadInProgress) yield break; | ||||
|         LoadInProgress = true; | ||||
|         ModelId = int.Parse(mIdLong); | ||||
|         CostumeName = modelName; | ||||
|         AnimationName = animSetName; | ||||
|  | ||||
|         using(new KeyframeToggleContext(this)) | ||||
|         { | ||||
|             yield return GetModel(mIdLong, mCostume); | ||||
|             yield return GetAnimations(aIdLong); | ||||
|             SetAnimationReferences(); | ||||
|             SetBones(); | ||||
|             DoStuff(); | ||||
|         } | ||||
|         SetKeyframe(); | ||||
|         enabled = true; | ||||
|     } | ||||
|  | ||||
|     public virtual void SetAnimationReferences() {} | ||||
|  | ||||
|     public virtual void SetBones() {} | ||||
|  | ||||
|     public virtual void DoStuff() {} | ||||
|  | ||||
|     public virtual void ToggleBonesVisible(bool value) | ||||
|     { | ||||
|         BonesVisible = value; | ||||
|         foreach (var handle in Handles.Where(h => h as UIHandleBone != null)) | ||||
|         { | ||||
|             handle.ToggleActive(value); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void TogglePhysics() | ||||
|     { | ||||
|         TogglePhysics(!PhysicsEnabled); | ||||
|     } | ||||
|  | ||||
|     public void TogglePhysics(bool value = true) | ||||
|     { | ||||
|         PhysicsEnabled = value; | ||||
|         foreach (var handle in Handles.Where(h => h.GetType() == typeof(UIHandlePhysicsBone))) | ||||
|         { | ||||
|             handle.Target.GetComponent<Osage>().enabled = value; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void ResetBones() | ||||
|     { | ||||
|         foreach (var bone in Handles) | ||||
|         { | ||||
|             bone.TransformResetAll(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public string GetAnimationName() | ||||
|     { | ||||
|         if (BodySimpleAnimation.clip != null) | ||||
|         { | ||||
|             return BodySimpleAnimation.GetStates().FirstOrDefault(st => st.clip.name == BodySimpleAnimation.clip.name).name; | ||||
|         } | ||||
|         else return ""; | ||||
|     } | ||||
|  | ||||
|     public void PlayBodyAnimation(string clipName) | ||||
|     { | ||||
|         PlayAnimation(BodySimpleAnimation, clipName); | ||||
|     } | ||||
|  | ||||
|     public void PlayAnimation(SimpleAnimation anim, string clipName, float time = -1) | ||||
|     { | ||||
|         if (anim == null) return; | ||||
|         else if (string.IsNullOrEmpty(clipName)) | ||||
|         { | ||||
|             anim.Stop(); | ||||
|             anim.clip = null; | ||||
|             anim.enabled = false; | ||||
|             return; | ||||
|         } | ||||
|         anim.enabled = true; | ||||
|         anim.clip = anim.GetState(clipName).clip; | ||||
|         anim.Play(anim.GetStates().FirstOrDefault(state => state.clip == anim.clip).name); | ||||
|         anim.GetStates().FirstOrDefault(state => state.clip == anim.clip).speed = AnimationSpeed; | ||||
|         if(time != -1) | ||||
|         { | ||||
|             anim.GetStates().FirstOrDefault(state => state.clip == anim.clip).time = time; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void RewindAllAnimations() | ||||
|     { | ||||
|         if (BodySimpleAnimation && BodySimpleAnimation.clip != null) | ||||
|         { | ||||
|             BodySimpleAnimation.Rewind(); | ||||
|         } | ||||
|         if (this as KF3FriendContainer != null) | ||||
|         { | ||||
|             var EarsSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             var TailSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             if (EarsSimpleAnimation && EarsSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 EarsSimpleAnimation.Rewind(); | ||||
|             } | ||||
|             if (TailSimpleAnimation && TailSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 TailSimpleAnimation.Rewind(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void UnwindAllAnimations() | ||||
|     { | ||||
|         if (BodySimpleAnimation && BodySimpleAnimation.clip != null) | ||||
|         { | ||||
|             BodySimpleAnimation.Unwind(); | ||||
|         } | ||||
|         if (this as KF3FriendContainer != null) | ||||
|         { | ||||
|             var EarsSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             var TailSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             if (EarsSimpleAnimation && EarsSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 EarsSimpleAnimation.Unwind(); | ||||
|             } | ||||
|             if (TailSimpleAnimation && TailSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 TailSimpleAnimation.Unwind(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void SetAnimationTimeScale(float timeScale) | ||||
|     { | ||||
|         if (BodySimpleAnimation && BodySimpleAnimation.clip != null) | ||||
|         { | ||||
|             SimpleAnimation.State currentClip = BodySimpleAnimation.GetStates().FirstOrDefault(state => state.clip == BodySimpleAnimation.clip); | ||||
|             currentClip.speed = timeScale; | ||||
|         } | ||||
|         if (this as KF3FriendContainer != null) | ||||
|         { | ||||
|             var EarsSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             var TailSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             if (EarsSimpleAnimation && EarsSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 SimpleAnimation.State currentClip = EarsSimpleAnimation.GetStates().FirstOrDefault(state => state.clip == EarsSimpleAnimation.clip); | ||||
|                 currentClip.speed = timeScale; | ||||
|             } | ||||
|             if (TailSimpleAnimation && TailSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 SimpleAnimation.State currentClip = TailSimpleAnimation.GetStates().FirstOrDefault(state => state.clip == TailSimpleAnimation.clip); | ||||
|                 currentClip.speed = timeScale; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void ChangeAnimationTimeScale(int time) | ||||
|     { | ||||
|         if (BodySimpleAnimation && BodySimpleAnimation.clip != null) | ||||
|         { | ||||
|             SimpleAnimation.State currentClip = BodySimpleAnimation.GetStates().FirstOrDefault(state => state.clip == BodySimpleAnimation.clip); | ||||
|             currentClip.speed += 0.2f * time; | ||||
|         } | ||||
|         if (this as KF3FriendContainer != null) | ||||
|         { | ||||
|             var EarsSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             var TailSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             if (EarsSimpleAnimation && EarsSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 SimpleAnimation.State currentClip = EarsSimpleAnimation.GetStates().FirstOrDefault(state => state.clip == EarsSimpleAnimation.clip); | ||||
|                 currentClip.speed += 0.2f * time; | ||||
|             } | ||||
|             if (TailSimpleAnimation && TailSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 SimpleAnimation.State currentClip = TailSimpleAnimation.GetStates().FirstOrDefault(state => state.clip == TailSimpleAnimation.clip); | ||||
|                 currentClip.speed += 0.2f * time; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void ResetAnimationTimeScale() | ||||
|     { | ||||
|         if (BodySimpleAnimation && BodySimpleAnimation.clip != null) | ||||
|         { | ||||
|             SimpleAnimation.State currentClip = BodySimpleAnimation.GetStates().FirstOrDefault(state => state.clip == BodySimpleAnimation.clip); | ||||
|             currentClip.speed = currentClip.speed == 0 ? 1 : 0; | ||||
|         } | ||||
|         if (this as KF3FriendContainer != null) | ||||
|         { | ||||
|             var EarsSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             var TailSimpleAnimation = ((KF3FriendContainer)this).EarsSimpleAnimation; | ||||
|             if (EarsSimpleAnimation && EarsSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 SimpleAnimation.State currentClip = EarsSimpleAnimation.GetStates().FirstOrDefault(state => state.clip == EarsSimpleAnimation.clip); | ||||
|                 currentClip.speed = currentClip.speed == 0 ? 1 : 0; | ||||
|             } | ||||
|             if (TailSimpleAnimation && TailSimpleAnimation.clip != null) | ||||
|             { | ||||
|                 SimpleAnimation.State currentClip = TailSimpleAnimation.GetStates().FirstOrDefault(state => state.clip == TailSimpleAnimation.clip); | ||||
|                 currentClip.speed = currentClip.speed == 0 ? 1 : 0; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public override void SetKeyframe(int frameNum = -1) | ||||
|     { | ||||
|         base.SetKeyframe(frameNum); | ||||
|     } | ||||
|  | ||||
|     protected CharaModelReferencer spawnAndGetReferencer(AssetBundle ab) | ||||
|     { | ||||
|         if (ab != null) | ||||
|         { | ||||
|             GameObject go = Instantiate(ab.LoadAsset(ab.GetAllAssetNames()[0]) as GameObject, transform); | ||||
|             ab.Unload(false); | ||||
|             return go.GetComponent<CharaModelReferencer>(); | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     /// <summary> Find and load all files related to selected model </summary> | ||||
|     public virtual IEnumerator GetModel(string bodyIdLong, string costumeId) | ||||
|     { | ||||
|         yield break; | ||||
|     } | ||||
|  | ||||
|     /// <summary> Find and load all files related to selected animation set </summary> | ||||
|     public virtual IEnumerator GetAnimations(string idLong) | ||||
|     { | ||||
|         yield break; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3CharacterContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3CharacterContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: c13c0b3d8ec32244794be75bdce3fd14 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
| @@ -0,0 +1,60 @@ | ||||
|  | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
|  | ||||
| [System.Serializable] | ||||
| public class KF3CharacterContainerSerializable : KF3ObjectContainerSerializable | ||||
| { | ||||
|     public bool IsCerulean; | ||||
|     public int ModelId; | ||||
|     public string CostumeName; | ||||
|     public string AnimationName; | ||||
|  | ||||
|     public KF3CharacterContainerSerializable() { } | ||||
|  | ||||
|     public KF3CharacterContainerSerializable(KF3CharacterContainer container) | ||||
|     { | ||||
|         this.GUID = container.GUID; | ||||
|         this.ModelId = container.ModelId; | ||||
|         this.CostumeName = container.CostumeName; | ||||
|         this.AnimationName = container.AnimationName; | ||||
|         this.IsCerulean = container as KF3CeruleanContainer != null; | ||||
|         this.Frames = container.Frames.Select(f => new FrameContent(f)).ToList(); | ||||
|     } | ||||
|  | ||||
|     public KF3CharacterContainerSerializable(KF3CharacterContainerSerializable source) | ||||
|     { | ||||
|         this.ModelId = source.ModelId; | ||||
|         this.CostumeName = source.CostumeName; | ||||
|         this.AnimationName = source.AnimationName; | ||||
|         this.IsCerulean = source.IsCerulean; | ||||
|         this.Filename = source.Filename; | ||||
|         this.GUID = source.GUID; | ||||
|         this.Frames = source.Frames.Select(f => new FrameContent(f)).ToList(); | ||||
|     } | ||||
|  | ||||
|     public static string GetRendererName(KF3ObjectContainer container1, Renderer r) | ||||
|     { | ||||
|         var container = container1 as KF3FriendContainer; | ||||
|         if (container == null) return r.gameObject.name; | ||||
|         else if (r.gameObject.name.ToLower() == "model") | ||||
|         { | ||||
|             if (r.transform.parent == container.Body.transform) | ||||
|                 return "hair"; | ||||
|             else if (container.Ears && r.transform.parent == container.Ears.transform) | ||||
|                 return "ears"; | ||||
|             else if (container.EarsAlt && r.transform.parent == container.EarsAlt.transform) | ||||
|                 return "ears (alt)"; | ||||
|             else if (container.Tail && r.transform.parent == container.Tail.transform) | ||||
|                 return "tail"; | ||||
|             else if (container.TailAlt && r.transform.parent == container.TailAlt.transform) | ||||
|                 return "tail (alt)"; | ||||
|             else | ||||
|                 return r.gameObject.name; | ||||
|         } | ||||
|         else | ||||
|             return r.gameObject.name; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: c2af1ff3ca27f394aaf69496edffa73a | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										746
									
								
								Assets/KF3/Scripts/Containers/KF3FriendContainer.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										746
									
								
								Assets/KF3/Scripts/Containers/KF3FriendContainer.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,746 @@ | ||||
| using KF3.Containers; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
| using UnityEngine.UI; | ||||
|  | ||||
| public class KF3FriendContainer : KF3CharacterContainer | ||||
| { | ||||
|     public bool | ||||
|         EyesLocked = false; | ||||
|     public float | ||||
|         LookAtStrength; | ||||
|     public Transform | ||||
|         LeftEye, | ||||
|         RightEye, | ||||
|         SubWeapon, | ||||
|         SubWeaponBone; | ||||
|     public UIHandleEyes | ||||
|         EyeTarget; | ||||
|     public Quaternion | ||||
|         LeftEyeRotation = Quaternion.identity, | ||||
|         RightEyeRotation = Quaternion.identity; | ||||
|     /// <summary> Original data </summary> | ||||
|     public CharaModelReferencer | ||||
|         Ears, | ||||
|         EarsAlt, | ||||
|         Tail, | ||||
|         TailAlt; | ||||
|     public CharaModelReferencer | ||||
|         EarsAnimation, | ||||
|         TailAnimation; | ||||
|     /// <summary> Custom Animator </summary> | ||||
|     public SimpleAnimation | ||||
|         EarsSimpleAnimation, | ||||
|         TailSimpleAnimation; | ||||
|  | ||||
|     public Dictionary<HumanBodyBones, Transform> HumanBones = new Dictionary<HumanBodyBones, Transform>(); | ||||
|     private Dictionary<Transform, UIHandle>     BoneHandles = new Dictionary<Transform, UIHandle>(); | ||||
|     //private Dictionary<Transform, HumanBodyBones> HumanBonesInverse = new Dictionary<Transform, HumanBodyBones>(); | ||||
|  | ||||
|     public UIKF3MorphPanel MorphPanel; | ||||
|     public UIKF3CharacterPanel CharacterPanel; | ||||
|  | ||||
|     private bool isFakeFriend = false; | ||||
|  | ||||
|     public static IEnumerator CreateAsync(string modelName, string animationSetName, bool fakeFriend = false, System.Action<KF3FriendContainer> callback = null) | ||||
|     { | ||||
|         GameObject go = new GameObject(modelName); | ||||
|         var container = go.AddComponent<KF3FriendContainer>(); | ||||
|         if (fakeFriend) container.DoNotSave = container.isFakeFriend = true; | ||||
|  | ||||
|         yield return container.BuildGeneral(modelName, animationSetName); | ||||
|         if (!container.isFakeFriend) UIHandleFriend.CreateAsChild(container); | ||||
|         container.LoadInProgress = false; | ||||
|         callback?.Invoke(container); | ||||
|     } | ||||
|  | ||||
|     protected override void Start() | ||||
|     { | ||||
|         if (isFakeFriend) return; | ||||
|  | ||||
|         LeftEyeRotation = LeftEye.localRotation; | ||||
|         RightEyeRotation = RightEye.localRotation; | ||||
|  | ||||
|         base.Start(); | ||||
|     } | ||||
|  | ||||
|     private void Update() | ||||
|     { | ||||
|         if (LoadInProgress || isFakeFriend) return; | ||||
|         if (BodySimpleAnimation && BodySimpleAnimation.clip != null) //check if simple animation component has been set | ||||
|         { | ||||
|             SimpleAnimation.State currentClip = BodySimpleAnimation.GetStates().FirstOrDefault(state => state.clip == BodySimpleAnimation.clip); | ||||
|             if (currentClip.normalizedTime == 1 && currentClip.speed > 0) //check if an animation is playing and if an animation was playing before | ||||
|             { | ||||
|                 RewindAllAnimations(); | ||||
|             } | ||||
|             else if (currentClip.normalizedTime <= 0 && currentClip.speed < 0) //check if an animation is playing and if an animation was playing before | ||||
|             { | ||||
|                 UnwindAllAnimations(); | ||||
|             } | ||||
|         } | ||||
|         if ((LeftEye && RightEye && EyeTarget) && !EyesLocked) | ||||
|         { | ||||
|             Vector3 target = Vector3.Lerp(EyeTarget.transform.position, KF3ModelViewerMain.Instance.GetCamera().transform.position, LookAtStrength); | ||||
|             LeftEye.LookAt(target, HumanBones[HumanBodyBones.Head].up); | ||||
|  | ||||
|             RightEye.LookAt(target, HumanBones[HumanBodyBones.Head].up); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     #region Setup | ||||
|     public override void SetAnimationReferences() | ||||
|     { | ||||
|         if (BodyAnimation) | ||||
|         { | ||||
|             BodySimpleAnimation = Body.GetComponentInChildren<SimpleAnimation>(); | ||||
|             if (Main.OverrideClip != null) | ||||
|             { | ||||
|                 foreach (var anim in BodyAnimation.prefabAnimeList) | ||||
|                 { | ||||
|                     anim.clip = Main.OverrideClip; | ||||
|                 } | ||||
|             } | ||||
|             Body.refAnimationObj = BodyAnimation.gameObject; | ||||
|             Body.JoinReferenceParam(); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Error.Log(Color.blue, "Body Animations Missing"); | ||||
|         } | ||||
|  | ||||
|         if (Ears && EarsAnimation) | ||||
|         { | ||||
|             EarsSimpleAnimation = Ears.GetComponentInChildren<SimpleAnimation>(); | ||||
|  | ||||
|             Ears.transform.SetParent(Body.boneList.FirstOrDefault(b => b.name == "j_head")); | ||||
|             Ears.transform.ResetTransform(); | ||||
|  | ||||
|             Ears.refAnimationObj = EarsAnimation.gameObject; | ||||
|             Ears.JoinReferenceParam(); | ||||
|  | ||||
|             if (EarsAlt) | ||||
|             { | ||||
|                 EarsAlt.transform.SetParent(Body.boneList.FirstOrDefault(b => b.name == "j_head")); | ||||
|                 EarsAlt.transform.ResetTransform(); | ||||
|                 EarsAlt.GetComponentInChildren<Renderer>().enabled = false; | ||||
|             } | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Error.Log(Color.blue, "Ears Missing"); | ||||
|         } | ||||
|  | ||||
|         if (Tail && TailAnimation) | ||||
|         { | ||||
|             TailSimpleAnimation = Tail.GetComponentInChildren<SimpleAnimation>(); | ||||
|  | ||||
|             Tail.transform.SetParent(Body.boneList.FirstOrDefault(b => b.name == (string.IsNullOrEmpty(BodyAnimation.tailNodeName) ? "j_lowerbody" : BodyAnimation.tailNodeName))); | ||||
|             Tail.transform.ResetTransform(); | ||||
|  | ||||
|             Tail.refAnimationObj = TailAnimation.gameObject; | ||||
|             Tail.JoinReferenceParam(); | ||||
|  | ||||
|             if (TailAlt) | ||||
|             { | ||||
|                 TailAlt.transform.SetParent(Body.boneList.FirstOrDefault(b => b.name == (string.IsNullOrEmpty(BodyAnimation.tailNodeName) ? "j_lowerbody" : BodyAnimation.tailNodeName))); | ||||
|                 TailAlt.transform.ResetTransform(); | ||||
|                 TailAlt.GetComponentInChildren<Renderer>().enabled = false; | ||||
|             } | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Error.Log(Color.blue, "Tail Missing"); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public override void SetBones() | ||||
|     { | ||||
|         if (isFakeFriend) return; | ||||
|  | ||||
|         HumanBones = new Dictionary<HumanBodyBones, Transform>(); | ||||
|         var extraBones = Body.boneList.Where(b => b.name.Contains("osg")); | ||||
|         HumanBones.Add(HumanBodyBones.Spine,            Body.transform.Find("root/pelvis")); | ||||
|         HumanBones.Add(HumanBodyBones.Hips,             Body.transform.Find("root/pelvis/j_lowerbody")); | ||||
|         HumanBones.Add(HumanBodyBones.RightUpperLeg,    Body.transform.Find("root/pelvis/j_lowerbody/j_thigh_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightLowerLeg,    Body.transform.Find("root/pelvis/j_lowerbody/j_thigh_r/j_leg_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightFoot,        Body.transform.Find("root/pelvis/j_lowerbody/j_thigh_r/j_leg_r/j_foot_r")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftUpperLeg,     Body.transform.Find("root/pelvis/j_lowerbody/j_thigh_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftLowerLeg,     Body.transform.Find("root/pelvis/j_lowerbody/j_thigh_l/j_leg_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftFoot,         Body.transform.Find("root/pelvis/j_lowerbody/j_thigh_l/j_leg_l/j_foot_l")); | ||||
|         HumanBones.Add(HumanBodyBones.Chest,            Body.transform.Find("root/pelvis/j_upperbody")); | ||||
|         HumanBones.Add(HumanBodyBones.UpperChest,       Body.transform.Find("root/pelvis/j_upperbody/j_chest")); | ||||
|         HumanBones.Add(HumanBodyBones.Neck,             Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_neck")); | ||||
|         HumanBones.Add(HumanBodyBones.Head,             Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_neck/j_head")); | ||||
|         HumanBones.Add(HumanBodyBones.RightShoulder,            Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightUpperArm,            Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r/j_arm_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightLowerArm,            Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r/j_arm_r/j_forearm_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightHand,                Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r/j_arm_r/j_forearm_r/j_wrist_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightIndexProximal,       Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r/j_arm_r/j_forearm_r/j_wrist_r/j_index_a_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightIndexIntermediate,   Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r/j_arm_r/j_forearm_r/j_wrist_r/j_index_a_r/j_index_b_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightRingProximal,        Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r/j_arm_r/j_forearm_r/j_wrist_r/j_ring_a_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightRingIntermediate,    Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r/j_arm_r/j_forearm_r/j_wrist_r/j_ring_a_r/j_ring_b_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightThumbProximal,       Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r/j_arm_r/j_forearm_r/j_wrist_r/j_thumb_a_r")); | ||||
|         HumanBones.Add(HumanBodyBones.RightThumbIntermediate,   Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_r/j_arm_r/j_forearm_r/j_wrist_r/j_thumb_a_r/j_thumb_b_r")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftShoulder,             Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftUpperArm,             Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l/j_arm_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftLowerArm,             Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l/j_arm_l/j_forearm_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftHand,                 Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l/j_arm_l/j_forearm_l/j_wrist_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftIndexProximal,        Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l/j_arm_l/j_forearm_l/j_wrist_l/j_index_a_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftIndexIntermediate,    Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l/j_arm_l/j_forearm_l/j_wrist_l/j_index_a_l/j_index_b_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftRingProximal,         Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l/j_arm_l/j_forearm_l/j_wrist_l/j_ring_a_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftRingIntermediate,     Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l/j_arm_l/j_forearm_l/j_wrist_l/j_ring_a_l/j_ring_b_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftThumbProximal,        Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l/j_arm_l/j_forearm_l/j_wrist_l/j_thumb_a_l")); | ||||
|         HumanBones.Add(HumanBodyBones.LeftThumbIntermediate,    Body.transform.Find("root/pelvis/j_upperbody/j_chest/j_shoulder_l/j_arm_l/j_forearm_l/j_wrist_l/j_thumb_a_l/j_thumb_b_l")); | ||||
|         //HumanBonesInverse = HumanBones.Where(d=>d.Value != null).ToDictionary((i) => i.Value, (i) => i.Key); | ||||
|  | ||||
|         if (Tail) | ||||
|         { | ||||
|             extraBones = extraBones.Union(Tail.boneList.Where(b => b.name.Contains("osg"))); | ||||
|         } | ||||
|         if (TailAlt) | ||||
|         { | ||||
|             extraBones = extraBones.Union(TailAlt.boneList.Where(b => b.name.Contains("osg"))); | ||||
|         } | ||||
|         if (Ears) | ||||
|         { | ||||
|             extraBones = extraBones.Union(Ears.boneList.Where(b => b.name.Contains("osg"))); | ||||
|         } | ||||
|         if (EarsAlt) | ||||
|         { | ||||
|             extraBones = extraBones.Union(EarsAlt.boneList.Where(b => b.name.Contains("osg"))); | ||||
|         } | ||||
|  | ||||
|         var allBones = HumanBones.Where(b => b.Value != null).Select(b => b.Value).Union(Body.transform.Find("root")?.GetComponentsInChildren<Transform>().Where(t => t.name.Contains("weapon")).ToList()).Union(extraBones).Distinct(); | ||||
|  | ||||
|         foreach (var bone in allBones) | ||||
|         { | ||||
|             var tags = new List<SerializableBone.BoneTags>(); | ||||
|             UIHandle handle; | ||||
|  | ||||
|             if (HumanBones.ContainsValue(bone)) | ||||
|                 tags.Add(SerializableBone.BoneTags.Humanoid); | ||||
|             if (bone.name.EndsWith("_l")) | ||||
|                 tags.Add(SerializableBone.BoneTags.Left); | ||||
|             else if (bone.name.EndsWith("_r")) | ||||
|                 tags.Add(SerializableBone.BoneTags.Right); | ||||
|  | ||||
|             if (extraBones.Contains(bone)) | ||||
|             { | ||||
|                 if (bone.GetComponent<Osage>() != null) | ||||
|                 { | ||||
|                     tags.Add(SerializableBone.BoneTags.Dynamic); | ||||
|                     handle = UIHandlePhysicsBone.CreateAsChild(this, bone, tags).SetColor(Color.cyan); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     handle = UIHandleBone.CreateAsChild(this, bone, tags).SetColor(Color.cyan); | ||||
|                 } | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 handle = UIHandleBone.CreateAsChild(this, bone, tags); | ||||
|             } | ||||
|  | ||||
|             if (bone == HumanBones[HumanBodyBones.Hips]) | ||||
|                 handle.SetOffset(bone.up * -0.02f); | ||||
|             if (bone == HumanBones[HumanBodyBones.Chest]) | ||||
|                 handle.SetOffset(bone.up * -0.02f); | ||||
|  | ||||
|             BoneHandles.Add(bone, handle); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public override void DoStuff() | ||||
|     { | ||||
|         if (isFakeFriend) return; | ||||
|  | ||||
|         UIKF3MorphSlider eyeBase = null; | ||||
|  | ||||
|         foreach (Renderer r in GetComponentsInChildren<Renderer>()) | ||||
|         { | ||||
|             foreach (Material mat in r.materials) | ||||
|             { | ||||
| #if UNITY_ANDROID | ||||
|                     if(!mat.shader.name.EndsWith("V2")) | ||||
|                         mat.shader = Shader.Find(mat.shader.name + "V2"); | ||||
| #endif | ||||
|                 if (mat.shader.name == "PRD/Cheek") | ||||
|                 { | ||||
|                     Texture2D tex = mat.GetTexture("_BaseMap") as Texture2D; | ||||
|                     mat.shader = Shader.Find("Unlit/Transparent"); | ||||
|                     mat.mainTexture = tex; | ||||
|                 } | ||||
|             } | ||||
|             Renderers.Add(r); | ||||
|         } | ||||
|  | ||||
|         var morphPanel = MorphPanel = UIKF3MorphPanel.Create(this); | ||||
|         var charaPanel = CharacterPanel = UIKF3CharacterPanel.Create(this); | ||||
|         InstantiatedObjects.Add(morphPanel.gameObject); | ||||
|         InstantiatedObjects.Add(charaPanel.gameObject); | ||||
|  | ||||
|         foreach (Transform child in GetComponentsInChildren<Transform>()) | ||||
|         { | ||||
|             switch (child.name) | ||||
|             { | ||||
|                 case "md_eye_base": | ||||
|                     { | ||||
|                         UIKF3MorphSlider.CreateLookAt(this, morphPanel.EyesPanel); | ||||
|  | ||||
|                         SkinnedMeshRenderer meshRenderer = child.GetComponent<SkinnedMeshRenderer>(); | ||||
|                         if (meshRenderer == null || meshRenderer.sharedMesh == null) break; | ||||
|                         for (int i = 0; i < meshRenderer.sharedMesh.blendShapeCount; i++) | ||||
|                         { | ||||
|                             UIKF3MorphSlider.CreateMorph(this, meshRenderer, i, "BS_eye.eye_", morphPanel.EyesPanel); | ||||
|                         } | ||||
|  | ||||
|                         if (HumanBones.ContainsKey(HumanBodyBones.Head) && HumanBones[HumanBodyBones.Head] != null && !EyeTarget) | ||||
|                         { | ||||
|                             Transform head = HumanBones[HumanBodyBones.Head]; | ||||
|                             EyeTarget = UIHandleEyes.Create(this, head); | ||||
|                         } | ||||
|                         eyeBase = UIKF3MorphSlider.CreateEyeToggle(this, meshRenderer, morphPanel.EyesPanel, MorphPanel.EyesToggleGroup); | ||||
|                         break; | ||||
|                     } | ||||
|                 case "md_eye_special_a": | ||||
|                 case "md_eye_special_b": | ||||
|                     { | ||||
|                         SkinnedMeshRenderer meshRenderer = child.GetComponent<SkinnedMeshRenderer>(); | ||||
|                         var toggle = UIKF3MorphSlider.CreateEyeToggle(this, meshRenderer, morphPanel.EyesPanel, MorphPanel.EyesToggleGroup); | ||||
|                         break; | ||||
|                     } | ||||
|                 case "md_mouth_base": | ||||
|                     { | ||||
|                         SkinnedMeshRenderer meshRenderer = child.GetComponent<SkinnedMeshRenderer>(); | ||||
|                         if (meshRenderer == null || meshRenderer.sharedMesh == null) break; | ||||
|                         for (int i = 0; i < meshRenderer.sharedMesh.blendShapeCount; i++) | ||||
|                         { | ||||
|                             UIKF3MorphSlider.CreateMorph(this, meshRenderer, i, "BS_mouth.mouth_", morphPanel.MouthPanel); | ||||
|                         } | ||||
|                         break; | ||||
|                     } | ||||
|                 case "md_eye_l": LeftEye = child; break; | ||||
|                 case "md_eye_r": RightEye = child; break; | ||||
|                 case "md_brow_base": | ||||
|                     { | ||||
|                         SkinnedMeshRenderer meshRenderer = child.GetComponent<SkinnedMeshRenderer>(); | ||||
|                         if (meshRenderer == null || meshRenderer.sharedMesh == null) break; | ||||
|  | ||||
|                         for (int i = 0; i < meshRenderer.sharedMesh.blendShapeCount; i++) | ||||
|                         { | ||||
|                             UIKF3MorphSlider.CreateMorph(this, meshRenderer, i, "BS_brow.brow_", morphPanel.EyebrowsPanel); | ||||
|                         } | ||||
|                         break; | ||||
|                     } | ||||
|                 case "md_subweapon": | ||||
|                     { | ||||
|                         SubWeapon = child; | ||||
|                         if (SubWeaponBone == null) break; | ||||
|                         SubWeapon.SetParent(SubWeaponBone); | ||||
|                         SubWeapon.SetPositionAndRotation(Vector3.zero, Quaternion.identity); | ||||
|                         break; | ||||
|                     } | ||||
|                 case "subweapon": | ||||
|                     { | ||||
|                         SubWeaponBone = child; | ||||
|                         if (SubWeapon == null) break; | ||||
|                         SubWeapon.SetParent(SubWeaponBone); | ||||
|                         SubWeapon.SetPositionAndRotation(Vector3.zero, Quaternion.identity); | ||||
|                         break; | ||||
|                     } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if(eyeBase != null) | ||||
|         { | ||||
|             eyeBase.Toggle.isOn = true; | ||||
|         } | ||||
|  | ||||
|         SetIK(HumanBodyBones.LeftUpperArm); | ||||
|         SetIK(HumanBodyBones.RightUpperArm); | ||||
|         SetIK(HumanBodyBones.LeftUpperLeg); | ||||
|         SetIK(HumanBodyBones.RightUpperLeg); | ||||
|         ToggleIK(true); | ||||
|     } | ||||
|  | ||||
|     public void SetIK(HumanBodyBones bone) | ||||
|     { | ||||
|         var cTr = transform; | ||||
|         UIHandleIK ikHandle = null; | ||||
|         Color orange = new Color(1.0f, 0.64f, 0.0f); | ||||
|         switch (bone) | ||||
|         { | ||||
|             case HumanBodyBones.LeftUpperArm: | ||||
|                 { | ||||
|                     if (HumanBones[HumanBodyBones.LeftHand] == null) return; | ||||
|                     InverseKinematics IK = gameObject.AddComponent<InverseKinematics>(); | ||||
|                     IK.upperArm = HumanBones[HumanBodyBones.LeftUpperArm]; | ||||
|                     IK.forearm = HumanBones[HumanBodyBones.LeftLowerArm]; | ||||
|                     IK.hand = HumanBones[HumanBodyBones.LeftHand]; | ||||
|  | ||||
|                     IK.elbow = UIHandleIK.CreateTransform("Elbow_L", transform, IK.forearm.position + -cTr.forward * 0.1f); | ||||
|                     UIHandleIK.CreateAsChild(this, IK.elbow, orange, IK.name, 0.75f); | ||||
|  | ||||
|                     IK.target = UIHandleIK.CreateTransform("Hand_L", transform, IK.hand.position, IK.hand.eulerAngles); | ||||
|                     ikHandle = UIHandleIK.CreateAsChild(this, IK.target, Color.green, IK.name, 2f); | ||||
|                     ikHandle.HiddenHandles = new List<UIHandle> { | ||||
|                         BoneHandles[IK.upperArm], | ||||
|                         BoneHandles[IK.forearm], | ||||
|                         BoneHandles[IK.hand], | ||||
|                     }; | ||||
|  | ||||
|                     IK.uppperArm_OffsetRotation = new Vector3(0, 90, 0); | ||||
|                     IK.forearm_OffsetRotation = new Vector3(-90, 90, 0); | ||||
|                     IK.SpawnLines(Color.green); | ||||
|                     break; | ||||
|                 } | ||||
|             case HumanBodyBones.RightUpperArm: | ||||
|                 { | ||||
|                     if (HumanBones[HumanBodyBones.RightHand] == null) return; | ||||
|                     InverseKinematics IK = gameObject.AddComponent<InverseKinematics>(); | ||||
|                     IK.upperArm = HumanBones[HumanBodyBones.RightUpperArm]; | ||||
|                     IK.forearm = HumanBones[HumanBodyBones.RightLowerArm]; | ||||
|                     IK.hand = HumanBones[HumanBodyBones.RightHand]; | ||||
|  | ||||
|                     IK.elbow = UIHandleIK.CreateTransform("Elbow_R", transform, IK.forearm.position + -cTr.forward * 0.1f); | ||||
|                     UIHandleIK.CreateAsChild(this, IK.elbow, orange, IK.name, 0.75f); | ||||
|  | ||||
|                     IK.target = UIHandleIK.CreateTransform("Hand_R", transform, IK.hand.position, IK.hand.eulerAngles); | ||||
|                     ikHandle = UIHandleIK.CreateAsChild(this, IK.target, Color.blue, IK.name, 2f); | ||||
|                     ikHandle.HiddenHandles = new List<UIHandle> { | ||||
|                         BoneHandles[IK.upperArm], | ||||
|                         BoneHandles[IK.forearm], | ||||
|                         BoneHandles[IK.hand], | ||||
|                     }; | ||||
|  | ||||
|                     IK.uppperArm_OffsetRotation = new Vector3(0, 90, 0); | ||||
|                     IK.forearm_OffsetRotation = new Vector3(-90, 90, 0); | ||||
|                     IK.SpawnLines(Color.blue); | ||||
|                     break; | ||||
|                 } | ||||
|             case HumanBodyBones.LeftUpperLeg: | ||||
|                 { | ||||
|                     if (HumanBones[HumanBodyBones.LeftFoot] == null) return; | ||||
|                     InverseKinematics IK = gameObject.AddComponent<InverseKinematics>(); | ||||
|                     IK.upperArm = HumanBones[HumanBodyBones.LeftUpperLeg]; | ||||
|                     IK.forearm = HumanBones[HumanBodyBones.LeftLowerLeg]; | ||||
|                     IK.hand = HumanBones[HumanBodyBones.LeftFoot]; | ||||
|  | ||||
|                     IK.elbow = UIHandleIK.CreateTransform("Knee_L", transform, IK.forearm.position + cTr.forward * 0.2f); | ||||
|                     UIHandleIK.CreateAsChild(this, IK.elbow, orange, IK.name, 0.75f); | ||||
|  | ||||
|                     IK.target = UIHandleIK.CreateTransform("Foot_L", transform, IK.hand.position, IK.hand.eulerAngles + cTr.forward * 45); | ||||
|                     ikHandle = UIHandleIK.CreateAsChild(this, IK.target, Color.green, IK.name, 2f); | ||||
|                     ikHandle.HiddenHandles = new List<UIHandle> { | ||||
|                         BoneHandles[IK.upperArm], | ||||
|                         BoneHandles[IK.forearm], | ||||
|                         BoneHandles[IK.hand], | ||||
|                     }; | ||||
|  | ||||
|                     IK.uppperArm_OffsetRotation = new Vector3(0, 90, 0); | ||||
|                     IK.forearm_OffsetRotation = new Vector3(-90, 90, 0); | ||||
|                     IK.hand_OffsetRotation = new Vector3(0, 0, -45); | ||||
|                     IK.SpawnLines(Color.green); | ||||
|                     break; | ||||
|                 } | ||||
|             case HumanBodyBones.RightUpperLeg: | ||||
|                 { | ||||
|                     if (HumanBones[HumanBodyBones.RightFoot] == null) return; | ||||
|                     InverseKinematics IK = gameObject.AddComponent<InverseKinematics>(); | ||||
|                     IK.upperArm = HumanBones[HumanBodyBones.RightUpperLeg]; | ||||
|                     IK.forearm = HumanBones[HumanBodyBones.RightLowerLeg]; | ||||
|                     IK.hand = HumanBones[HumanBodyBones.RightFoot]; | ||||
|  | ||||
|                     IK.elbow = UIHandleIK.CreateTransform("Knee_R", transform, IK.forearm.position + cTr.forward * 0.2f); | ||||
|                     UIHandleIK.CreateAsChild(this, IK.elbow, orange, IK.name, 0.75f); | ||||
|  | ||||
|                     IK.target = UIHandleIK.CreateTransform("Foot_R", transform, IK.hand.position, IK.hand.eulerAngles + cTr.forward * 45); | ||||
|                     ikHandle = UIHandleIK.CreateAsChild(this, IK.target, Color.blue, IK.name, 2f); | ||||
|                     ikHandle.HiddenHandles = new List<UIHandle> { | ||||
|                         BoneHandles[IK.upperArm], | ||||
|                         BoneHandles[IK.forearm], | ||||
|                         BoneHandles[IK.hand], | ||||
|                     }; | ||||
|  | ||||
|                     IK.uppperArm_OffsetRotation = new Vector3(0, 90, 0); | ||||
|                     IK.forearm_OffsetRotation = new Vector3(-90, 90, 0); | ||||
|                     IK.hand_OffsetRotation = new Vector3(0, 0, -45); | ||||
|                     IK.SpawnLines(Color.blue); | ||||
|                     break; | ||||
|                 } | ||||
|         } | ||||
|     } | ||||
|     #endregion | ||||
|  | ||||
|     #region Animation | ||||
|  | ||||
|     public void PlayEarsAnimation(string clipName) | ||||
|     { | ||||
|         PlayAnimation(EarsSimpleAnimation, clipName); | ||||
|     } | ||||
|  | ||||
|     public void PlayTailAnimation(string clipName) | ||||
|     { | ||||
|         PlayAnimation(TailSimpleAnimation, clipName); | ||||
|     } | ||||
|  | ||||
|     #endregion | ||||
|  | ||||
|     #region Control | ||||
|     public void UpdateLookAtTarget(float value) | ||||
|     { | ||||
|         LookAtStrength = value; | ||||
|     } | ||||
|  | ||||
|     public void UpdateMorph(SkinnedMeshRenderer meshRenderer, int id, float value, Slider slider = null) | ||||
|     { | ||||
|         meshRenderer.SetBlendShapeWeight(id, value); | ||||
|         Morphs[meshRenderer].First(m => m.Name == meshRenderer.sharedMesh.GetBlendShapeName(id)).Strength = value; | ||||
|         if (slider) | ||||
|             slider.SetValueWithoutNotify(value); | ||||
|     } | ||||
|  | ||||
|     #endregion | ||||
|  | ||||
|     #region Toggles | ||||
|     public void ToggleIK(bool value) | ||||
|     { | ||||
|         foreach (var ik in GetComponents<InverseKinematics>()) | ||||
|         { | ||||
|             ik.SoftEnabled = value; | ||||
|             ik.linesVisible = value; | ||||
|         } | ||||
|         foreach (UIHandleIK ikHandle in Handles.Where(h=>h.GetType() == typeof(UIHandleIK))) | ||||
|         { | ||||
|             foreach(var handle in ikHandle.HiddenHandles) | ||||
|             { | ||||
|                 handle.ForceDisplayOff(value); | ||||
|             } | ||||
|         } | ||||
|         IKEnabled = value; | ||||
|     } | ||||
|  | ||||
|     public override void ToggleBonesVisible(bool value) | ||||
|     { | ||||
|         base.ToggleBonesVisible(value); | ||||
|         if (EyeTarget != null) | ||||
|         { | ||||
|             EyeTarget.ToggleActive(value); | ||||
|         } | ||||
|     } | ||||
|     #endregion | ||||
|  | ||||
|     public override void Select() | ||||
|     { | ||||
|         MorphPanel.gameObject.SetActive(true); | ||||
|         CharacterPanel.gameObject.SetActive(true); | ||||
|     } | ||||
|  | ||||
|     public override void Deselect() | ||||
|     { | ||||
|         MorphPanel.gameObject.SetActive(false); | ||||
|         CharacterPanel.gameObject.SetActive(false); | ||||
|     } | ||||
|  | ||||
|     public override void PastePose(KeyframeData keyframe1, PoseLoadOptions pasteParams) | ||||
|     { | ||||
|         var keyframe = keyframe1 as CharacterKeyframeData; | ||||
|  | ||||
|         this.CurrentAnimation = keyframe.CurrentAnimation; | ||||
|         if (keyframe.CurrentAnimation == "") | ||||
|         { | ||||
|             ToggleIK(keyframe.IKEnabled); | ||||
|             this.PlayAnimation(this.BodySimpleAnimation, ""); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             ToggleIK(false); | ||||
|             int currentFrame = TimelineController.Instance.CurrentFrame; | ||||
|             FrameContent startFrame = null; | ||||
|             foreach (var frame in Frames) | ||||
|             { | ||||
|                 if (frame.FrameNum <= currentFrame && (frame.ObjectData as CharacterKeyframeData).CurrentAnimation == keyframe.CurrentAnimation) | ||||
|                 { | ||||
|                     if (startFrame == null || frame.FrameNum > startFrame.FrameNum) | ||||
|                     { | ||||
|                         startFrame = frame; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|             float diff = currentFrame - startFrame.FrameNum; | ||||
|             this.PlayAnimation(this.BodySimpleAnimation, keyframe.CurrentAnimation, diff * (TimelineController.Instance.FrameDelayMS/1000)); | ||||
|         } | ||||
|  | ||||
|         var body    = keyframe.Bones.FirstOrDefault(b => b.Name == "Body") ?? new BoneList(); | ||||
|         var ears    = keyframe.Bones.FirstOrDefault(b => b.Name == "Ears") ?? new BoneList(); | ||||
|         var tail    = keyframe.Bones.FirstOrDefault(b => b.Name == "Tail") ?? new BoneList(); | ||||
|         var earsAlt = keyframe.Bones.FirstOrDefault(b => b.Name == "EarsAlt") ?? new BoneList(); | ||||
|         var tailAlt = keyframe.Bones.FirstOrDefault(b => b.Name == "TailAlt") ?? new BoneList(); | ||||
|  | ||||
|         if (pasteParams.Root) | ||||
|         { | ||||
|             keyframe.Root.ApplyTo(transform); | ||||
|         } | ||||
|  | ||||
|         if (pasteParams.Body) | ||||
|         { | ||||
|             foreach (var bone in this.Body.boneList) | ||||
|             { | ||||
|                 if (pasteParams.Other || bone.GetComponent<Osage>() == null) | ||||
|                     body.Bones.FirstOrDefault(b => b.Name == bone.name)?.Transform.ApplyTo(bone, pasteParams); | ||||
|             } | ||||
|         } | ||||
|         if (pasteParams.Tail) | ||||
|         { | ||||
|             if (this.Tail != null) | ||||
|             { | ||||
|                 foreach (var bone in this.Tail.boneList) | ||||
|                 { | ||||
|                     tail.Bones.FirstOrDefault(b => b.Name == bone.name)?.Transform.ApplyTo(bone, pasteParams); | ||||
|                 } | ||||
|             } | ||||
|             if (this.TailAlt != null) | ||||
|             { | ||||
|                 foreach (var bone in this.TailAlt.boneList) | ||||
|                 { | ||||
|                     tailAlt.Bones.FirstOrDefault(b => b.Name == bone.name)?.Transform.ApplyTo(bone, pasteParams); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         if (pasteParams.Ears) | ||||
|         { | ||||
|             if (this.Ears != null) | ||||
|             { | ||||
|                 foreach (var bone in this.Ears.boneList) | ||||
|                 { | ||||
|                     ears.Bones.FirstOrDefault(b => b.Name == bone.name)?.Transform.ApplyTo(bone, pasteParams); | ||||
|                 } | ||||
|             } | ||||
|             if (this.EarsAlt != null && earsAlt != null) | ||||
|             { | ||||
|                 foreach (var bone in this.EarsAlt.boneList) | ||||
|                 { | ||||
|                     earsAlt.Bones.FirstOrDefault(b => b.Name == bone.name)?.Transform.ApplyTo(bone, pasteParams); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         foreach (var ik in GetComponentsInChildren<InverseKinematics>()) | ||||
|         { | ||||
|             var bones1 = keyframe.Bones.FirstOrDefault(b => b.Name == "Extra"); | ||||
|             if (bones1 != null) | ||||
|             { | ||||
|                 bones1.Bones.FirstOrDefault(b => b.Name == ik.target.name)?.Transform.ApplyTo(ik.target); | ||||
|                 bones1.Bones.FirstOrDefault(b => b.Name == ik.elbow.name)?.Transform.ApplyTo(ik.elbow); | ||||
|             } | ||||
|         } | ||||
|         if (pasteParams.Morphs) | ||||
|         { | ||||
|             //MorphPanel.PasteValues(keyframe.Renderers); | ||||
|             foreach (var morph in keyframe.Morphs) | ||||
|             { | ||||
|                 var rend = this.Morphs.Keys.FirstOrDefault(k => k.name == morph.ParentName); | ||||
|                 if (rend == null) continue; | ||||
|  | ||||
|                 MorphHelper h = this.Morphs[rend].FirstOrDefault(m => m.Name == morph.Name); | ||||
|                 if (h != null) this.UpdateMorph(rend, rend.sharedMesh.GetBlendShapeIndex(morph.Name), morph.Strength, h.Slider); | ||||
|             } | ||||
|         } | ||||
|         if (keyframe.Renderers != null) | ||||
|         { | ||||
|             foreach (var renderer in keyframe.Renderers) | ||||
|             { | ||||
|                 var rend = this.Renderers.FirstOrDefault(r => KF3CharacterContainerSerializable.GetRendererName(this, r) == renderer.Name); | ||||
|                 if (rend != null) | ||||
|                 { | ||||
|                     rend.enabled = renderer.Value; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         this.TogglePhysics(keyframe.PhysicsEnabled); | ||||
|         this.EyesLocked = keyframe.EyesLocked; | ||||
|         this.LeftEyeRotation = Quaternion.Euler(keyframe.LeftEyeRotation); | ||||
|         this.RightEyeRotation = Quaternion.Euler(keyframe.RightEyeRotation); | ||||
|         this.EyeTarget.transform.localPosition = keyframe.EyeTarget; | ||||
|         this.LookAtStrength = keyframe.LookAtStrength; | ||||
|         this.CharacterPanel.UpdateSelection(); | ||||
|     } | ||||
|  | ||||
|     public override IEnumerator GetModel(string bodyIdLong, string costumeId) | ||||
|     { | ||||
|         KF3AssetLibrary lib = Main.Assets; | ||||
|         List<KF3AssetBundle> abList = lib.AssetBundles.Where(ab => ab.FileName.StartsWith($"ch_{bodyIdLong}_")).ToList(); | ||||
|         KF3AssetBundle bundle; | ||||
|  | ||||
|         //load body | ||||
|         bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{bodyIdLong}_{costumeId}.prefab"); | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             Body = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|  | ||||
|         //load ears | ||||
|         bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{bodyIdLong}_{costumeId}_ear.prefab"); | ||||
|         if (bundle == null) | ||||
|         { | ||||
|             bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{bodyIdLong}_a_ear.prefab"); | ||||
|         } | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             Ears = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|  | ||||
|         bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{bodyIdLong}_z_ear.prefab"); | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             EarsAlt = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|  | ||||
|         //load tail | ||||
|         bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{bodyIdLong}_{costumeId}_tail.prefab"); | ||||
|         if (bundle == null) | ||||
|         { | ||||
|             bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{bodyIdLong}_a_tail.prefab"); | ||||
|         } | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             Tail = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|  | ||||
|         bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{bodyIdLong}_z_tail.prefab"); | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             TailAlt = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     public override IEnumerator GetAnimations(string idLong) | ||||
|     { | ||||
|         KF3AssetLibrary lib = Main.Assets; | ||||
|         KF3AssetBundle bundle; | ||||
|         List<KF3AssetBundle> abList = lib.AssetBundles.Where(ab => ab.FileName.StartsWith($"ch_{idLong}_")).ToList(); | ||||
|  | ||||
|         //load body motion | ||||
|         bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{idLong}_a_mot.prefab"); | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             BodyAnimation = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|  | ||||
|         //load ears motion | ||||
|         bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{idLong}_a_ear_mot.prefab"); | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             EarsAnimation = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|  | ||||
|         //load tail motion | ||||
|         bundle = abList.FirstOrDefault(ab => ab.FileName == $"ch_{idLong}_a_tail_mot.prefab"); | ||||
|         yield return lib.LoadAsset(bundle, (ab) => | ||||
|         { | ||||
|             TailAnimation = spawnAndGetReferencer(ab); | ||||
|         }); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3FriendContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3FriendContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 65acd7afcc45d3142a3b712abcd41531 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										58
									
								
								Assets/KF3/Scripts/Containers/KF3ObjectContainer.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								Assets/KF3/Scripts/Containers/KF3ObjectContainer.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,58 @@ | ||||
| using KF3.Containers; | ||||
| using System; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class KF3ObjectContainer : ObjectContainer | ||||
| { | ||||
|     protected override System.Type _serializeType => typeof(KF3ObjectContainerSerializable); | ||||
|  | ||||
|     public KF3CharacterContainer AsCharacter => this as KF3CharacterContainer; | ||||
|  | ||||
|     protected static KF3ModelViewerMain Main => KF3ModelViewerMain.Instance; | ||||
|  | ||||
|     protected override void Start() | ||||
|     { | ||||
|         if (DoNotSave) return; | ||||
|  | ||||
|         if(Frames.Count == 0) | ||||
|         { | ||||
|             SetKeyframe(); | ||||
|         } | ||||
|  | ||||
|         KF3ModelViewerMain.RegisterObject(this); | ||||
|         var selector = UITimelineObjectEntry.Create(this); | ||||
|         InstantiatedObjects.Add(selector.gameObject); | ||||
|  | ||||
|         KF3ModelViewerMain.Instance.SelectObject(this); | ||||
|     } | ||||
|  | ||||
|     protected override void OnDestroy() | ||||
|     { | ||||
|         if (Main.SelectedObject == this) | ||||
|         { | ||||
|             Main.SelectObject(null); | ||||
|         } | ||||
|  | ||||
|         KF3ModelViewerMain.UnregisterObject(this); | ||||
|  | ||||
|         base.OnDestroy(); | ||||
|     } | ||||
|  | ||||
|     #region Timeline | ||||
|     public override DataType GetDataType() | ||||
|     { | ||||
|         switch (this) | ||||
|         { | ||||
|             case KF3FriendContainer _: | ||||
|                 return DataType.Character; | ||||
|             case KF3CeruleanContainer _: | ||||
|                 return DataType.Character; | ||||
|             case KF3StaticContainer _: | ||||
|                 return DataType.Object; | ||||
|             default: | ||||
|                 Error.Log(Color.red, GetType().FullName); | ||||
|                 throw new NotImplementedException(); | ||||
|         } | ||||
|     } | ||||
|     #endregion | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3ObjectContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3ObjectContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: d028abe563d1f8142859213a6513cc27 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
| @@ -0,0 +1,12 @@ | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
|  | ||||
| [System.Serializable] | ||||
| public class KF3ObjectContainerSerializable : ObjectContainerSerializable | ||||
| { | ||||
|     public KF3ObjectContainerSerializable() : base() { } | ||||
|  | ||||
|     public KF3ObjectContainerSerializable(KF3ObjectContainer container) : base(container) { } | ||||
|  | ||||
|     public KF3ObjectContainerSerializable(KF3ObjectContainerSerializable source) : base(source) { } | ||||
| } | ||||
| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: a5a255f7822836f4f9cd74c5e12f5c9a | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										185
									
								
								Assets/KF3/Scripts/Containers/KF3SceneContainer.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										185
									
								
								Assets/KF3/Scripts/Containers/KF3SceneContainer.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,185 @@ | ||||
|  | ||||
| using KF3.Containers; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class KF3SceneContainer : SceneContainer | ||||
| { | ||||
|     public string BackgroundName = ""; | ||||
|     public Dictionary<string, GameObject> Backgrounds = new Dictionary<string, GameObject>(); | ||||
|     public string StageName = ""; | ||||
|     public Dictionary<string, GameObject> Stages = new Dictionary<string, GameObject>(); | ||||
|     public List<GameObject> InstantiatedObjects = new List<GameObject>(); | ||||
|     public List<FrameContent> Frames = new List<FrameContent>(); | ||||
|  | ||||
|     public UIKF3SceneSettings Settings; | ||||
|  | ||||
|     protected KF3ModelViewerMain Main => KF3ModelViewerMain.Instance; | ||||
|  | ||||
|     public override void Init(ModelViewerMain main1) | ||||
|     { | ||||
|         var main = main1 as KF3ModelViewerMain; | ||||
|         base.Init(main); | ||||
|         Settings = UIKF3SceneSettings.Create(this); | ||||
|         InstantiatedObjects.Add(Settings.gameObject); | ||||
|  | ||||
|         if (main.UI != null) | ||||
|         { | ||||
|             KF3ModelViewerInterface.SetDropdownData(Settings.StageDropdown, KF3ModelViewerMain.Instance.Assets.Stages.Select(s => s.DisplayName).ToList(), true); | ||||
|             KF3ModelViewerInterface.SetDropdownData(Settings.BackgroundDropdown, KF3ModelViewerMain.Instance.Assets.Skies.Select(s => s.DisplayName).ToList(), true); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void SetBackground(string newBackground) | ||||
|     { | ||||
|         if (newBackground == BackgroundName) return; | ||||
|         var currentBackground = BackgroundName; | ||||
|  | ||||
|         if (newBackground != "") | ||||
|         { | ||||
|             if (!Backgrounds.ContainsKey(newBackground)) | ||||
|             { | ||||
|                 Backgrounds[newBackground] = null; | ||||
|                 KF3ModelViewerMain.Instance.StartCoroutine(Main.Builder.SpawnAsset(newBackground, bg => | ||||
|                 { | ||||
|                     Backgrounds[newBackground] = bg; | ||||
|                     InstantiatedObjects.Add(bg); | ||||
|                 })); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 Backgrounds[newBackground]?.SetActive(true); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if (currentBackground != "") | ||||
|         { | ||||
|             Backgrounds[currentBackground]?.SetActive(false); | ||||
|  | ||||
|             var currentFrame = TimelineController.Instance.CurrentFrame; | ||||
|             bool containsCurrent = Frames.Where(f => (f.ObjectData as SceneKeyframe).Background == currentBackground && f.FrameNum != currentFrame).Any(); | ||||
|  | ||||
|             if (!containsCurrent) | ||||
|             { | ||||
|                 KF3ModelViewerMain.DisposeOf(Backgrounds[currentBackground]); | ||||
|                 Backgrounds.Remove(currentBackground); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         BackgroundName = newBackground; | ||||
|     } | ||||
|  | ||||
|     public void SetStage(string newStage) | ||||
|     { | ||||
|         if (newStage == StageName) return; | ||||
|         var currentStage = StageName; | ||||
|  | ||||
|         if (newStage != "") | ||||
|         { | ||||
|             if (!Stages.ContainsKey(newStage)) | ||||
|             { | ||||
|                 Stages[newStage] = null; | ||||
|                 KF3ModelViewerMain.Instance.StartCoroutine(Main.Builder.SpawnAsset(newStage, bg => | ||||
|                 { | ||||
|                     Stages[newStage] = bg; | ||||
|                     InstantiatedObjects.Add(bg); | ||||
|                 })); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 Stages[newStage]?.SetActive(true); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if (currentStage != "") | ||||
|         { | ||||
|             Stages[currentStage]?.SetActive(false); | ||||
|  | ||||
|             var currentFrame = TimelineController.Instance.CurrentFrame; | ||||
|             bool containsCurrent = Frames.Where(f => (f.ObjectData as SceneKeyframe).Stage == currentStage && f.FrameNum != currentFrame).Any(); | ||||
|  | ||||
|             if (!containsCurrent) | ||||
|             { | ||||
|                 KF3ModelViewerMain.DisposeOf(Stages[currentStage]); | ||||
|                 Stages.Remove(currentStage); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         StageName = newStage; | ||||
|     } | ||||
|  | ||||
|     public KeyframeData SerializeFrame() | ||||
|     { | ||||
|         return new SceneKeyframe(this); | ||||
|     } | ||||
|  | ||||
|     public override SceneSerializable Serialize() | ||||
|     { | ||||
|         return new KF3SceneSerializable(this); | ||||
|     } | ||||
|  | ||||
|     public void Lerp(KeyframeData frame1, KeyframeData frame2, float amount) | ||||
|     { | ||||
|         var frame = (frame1 as SceneKeyframe).Lerp(frame2, amount) as SceneKeyframe; | ||||
|         SetBackground(frame.Background); | ||||
|         SetStage(frame.Stage); | ||||
|     } | ||||
|  | ||||
|     public void GetClosestFrames(int frame, out FrameContent previousFrame, out FrameContent nextFrame) | ||||
|     { | ||||
|         previousFrame = null; | ||||
|         nextFrame = null; | ||||
|  | ||||
|         var frames = Frames.OrderBy(f => f.FrameNum).ToArray(); | ||||
|  | ||||
|         for (int i = 0; i < Frames.Count; i++) | ||||
|         { | ||||
|             if (Frames[i].FrameNum < frame) | ||||
|             { | ||||
|                 previousFrame = nextFrame = frames[i]; | ||||
|             } | ||||
|             else if (Frames[i].FrameNum == frame) | ||||
|             { | ||||
|                 previousFrame = nextFrame = frames[i]; | ||||
|                 break; | ||||
|             } | ||||
|             else if (Frames[i].FrameNum > frame) | ||||
|             { | ||||
|                 if (previousFrame == null) previousFrame = frames[i]; | ||||
|                 nextFrame = frames[i]; | ||||
|                 break; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public virtual void SetKeyframe(int frameNum = -1) | ||||
|     { | ||||
|         if (frameNum == -1) frameNum = TimelineController.Instance.CurrentFrame; | ||||
|  | ||||
|         GetClosestFrames(frameNum, out var previousFrame, out var nextFrame); | ||||
|  | ||||
|         FrameContent currentFrame = null; | ||||
|         if (previousFrame == null || previousFrame.FrameNum != frameNum) | ||||
|         { | ||||
|             currentFrame = new FrameContent(frameNum); | ||||
|             Frames.Add(currentFrame); | ||||
|             Frames = Frames.OrderBy(f => f.FrameNum).ToList(); | ||||
|         } | ||||
|         else if (previousFrame.FrameNum == frameNum) currentFrame = previousFrame; | ||||
|         else if (nextFrame.FrameNum == frameNum) currentFrame = nextFrame; | ||||
|  | ||||
|         currentFrame.SetObjectData(SerializeFrame()); | ||||
|  | ||||
|         TimelineController.UpdateTimeline(); | ||||
|     } | ||||
|  | ||||
|     public void SetDefaultFrame() | ||||
|     { | ||||
|         Frames = new List<FrameContent>() | ||||
|         { | ||||
|             new FrameContent(0).SetObjectData(SerializeFrame()) | ||||
|         }; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3SceneContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3SceneContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 557b17c6118f1824f87ce6c5681d326a | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										26
									
								
								Assets/KF3/Scripts/Containers/KF3SceneSerializable.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Assets/KF3/Scripts/Containers/KF3SceneSerializable.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Globalization; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
| using UnityEngine.Networking.Types; | ||||
|  | ||||
| [Serializable] | ||||
| public class KF3SceneSerializable : SceneSerializable | ||||
| { | ||||
|     public List<FrameContent> Frames = new List<FrameContent>(); | ||||
|  | ||||
|     public KF3SceneSerializable() { } | ||||
|  | ||||
|     public KF3SceneSerializable(KF3SceneContainer scene) | ||||
|     { | ||||
|         this.Version = Application.version; | ||||
|         this.Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture); ; | ||||
|         this.Timeline = new TimelineControllerSerializable(TimelineController.Instance); | ||||
|         this.Frames = scene.Frames.Select(f => new FrameContent(f)).ToList(); | ||||
|         foreach(var obj in scene.AllObjects) | ||||
|         { | ||||
|             Objects.Add(obj.Serialize() as KF3ObjectContainerSerializable); | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3SceneSerializable.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3SceneSerializable.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 049dacceaae7adb468b3c151f7985fef | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										286
									
								
								Assets/KF3/Scripts/Containers/KF3StaticContainer.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										286
									
								
								Assets/KF3/Scripts/Containers/KF3StaticContainer.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,286 @@ | ||||
| using System; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
| using UnityEngine.UIElements; | ||||
|  | ||||
| public class KF3StaticContainer : KF3ObjectContainer | ||||
| { | ||||
|     public bool CanBeSaved = true; | ||||
|     private bool paused = false; | ||||
|     public int SelectedMaterialVariant = 0; | ||||
|     private Dictionary<Renderer, List<Material[]>> _materialVariants = new Dictionary<Renderer, List<Material[]>>(); | ||||
|     private Material lineMaterial; | ||||
|     public List<GameObject> DetachableObjects = new List<GameObject>(); | ||||
|     private Dictionary<GameObject, Transform[]> linePoints = new Dictionary<GameObject, Transform[]>(); | ||||
|  | ||||
|     public UIKF3StaticSettings SettingsPanel; | ||||
|  | ||||
|     //private void Start() | ||||
|     //{ | ||||
|     //    KF3ModelContainer mc = gameObject.AddComponent<KF3ModelContainer>(); | ||||
|     //    mc.Renderers = this.renderers; | ||||
|     //} | ||||
|     public static KF3StaticContainer Create(AssetBundle ab) | ||||
|     { | ||||
|         if(ab == null) return null; | ||||
|  | ||||
|         GameObject go = Instantiate(ab.LoadAsset(ab.GetAllAssetNames()[0]) as GameObject); | ||||
|         var container = go.AddComponent<KF3StaticContainer>(); | ||||
|         container.name = ab.name; | ||||
|         UIHandleProp.CreateAsChild(container, go.transform); | ||||
|         container.Init(); | ||||
|  | ||||
|         ab.Unload(false); | ||||
|  | ||||
|         return container; | ||||
|     } | ||||
|  | ||||
|     public void Init() | ||||
|     { | ||||
|         Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(); | ||||
|  | ||||
|         foreach (Renderer renderer in renderers) | ||||
|         { | ||||
|             Material[] overrideMaterials = new Material[renderer.materials.Length]; | ||||
|             Material[] overrideMaterials2 = new Material[renderer.materials.Length]; | ||||
|             for (int i = 0; i < renderer.materials.Length; i++) | ||||
|             { | ||||
|                 if (renderer.materials[i].shader.name == "PRD/Stage") | ||||
|                 { | ||||
|                     overrideMaterials[i] = new Material(Shader.Find("PRD/FriendsShaderV2")); | ||||
|                     { | ||||
|                         overrideMaterials[i].SetTexture("_BaseMap", renderer.materials[i].mainTexture); | ||||
|                         overrideMaterials[i].SetTexture("_1st_ShadeMap", renderer.materials[i].mainTexture); | ||||
|                     } | ||||
|                     overrideMaterials2[i] = new Material(renderer.materials[i]); | ||||
|                     { | ||||
|                         overrideMaterials2[i].SetTexture("_ShadowTex", null); | ||||
|                     } | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     overrideMaterials[i] = overrideMaterials2[i] = renderer.materials[i]; | ||||
|                 } | ||||
|             } | ||||
|             AddMaterialVariant(renderer, renderer.materials); | ||||
|             AddMaterialVariant(renderer, overrideMaterials); | ||||
|             AddMaterialVariant(renderer, overrideMaterials2); | ||||
|         } | ||||
|  | ||||
|         SettingsPanel = UIKF3StaticSettings.Create(this); | ||||
|         InstantiatedObjects.Add(SettingsPanel.gameObject); | ||||
|     } | ||||
|  | ||||
|     public void PauseAll() | ||||
|     { | ||||
|         foreach (var par in transform.GetComponentsInChildren<ParticleSystem>()) | ||||
|         { | ||||
|             par.Pause(); | ||||
|         } | ||||
|         foreach (var anim in transform.GetComponentsInChildren<Animator>()) | ||||
|         { | ||||
|             anim.speed = 0; | ||||
|         } | ||||
|         paused = true; | ||||
|     } | ||||
|  | ||||
|     public void PlauseAll() | ||||
|     { | ||||
|         if (paused) | ||||
|             UnPauseAll(); | ||||
|         else | ||||
|             PauseAll(); | ||||
|     } | ||||
|  | ||||
|     public void UnPauseAll() | ||||
|     { | ||||
|         foreach (var par in transform.GetComponentsInChildren<ParticleSystem>()) | ||||
|         { | ||||
|             par.Play(); | ||||
|         } | ||||
|         foreach (var anim in transform.GetComponentsInChildren<Animator>()) | ||||
|         { | ||||
|             anim.speed = 1; | ||||
|         } | ||||
|         paused = false; | ||||
|     } | ||||
|  | ||||
|     public void ReStartAll() | ||||
|     { | ||||
|         foreach (var par in transform.GetComponentsInChildren<ParticleSystem>()) | ||||
|         { | ||||
|             par.time = 0; | ||||
|             par.Play(); | ||||
|         } | ||||
|         foreach (var anim in transform.GetComponentsInChildren<Animator>()) | ||||
|         { | ||||
|             anim.Play(anim.GetCurrentAnimatorStateInfo(0).shortNameHash, 0, 0); | ||||
|             anim.speed = 1; | ||||
|         } | ||||
|         paused = false; | ||||
|     } | ||||
|  | ||||
|     public void ToggleLines() | ||||
|     { | ||||
|         bool value = false; | ||||
|         foreach(var linePoint in linePoints) | ||||
|         { | ||||
|             value = !linePoint.Key.GetComponent<LineRenderer>().enabled; | ||||
|             break; | ||||
|         } | ||||
|         foreach (var linePoint in linePoints) | ||||
|         { | ||||
|             linePoint.Key.GetComponent<LineRenderer>().enabled = value; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     ////Set up UI knobs for every sub-objects of an animated effect | ||||
|     //public void BuildHierarchy() | ||||
|     //{ | ||||
|     //    foreach (var par in transform.GetComponentsInChildren<ParticleSystem>()) | ||||
|     //    { | ||||
|     //        if (par.transform.GetComponent<UIHandle>() == null) | ||||
|     //        { | ||||
|     //            par.gameObject.layer = 0; | ||||
|     //            par.gameObject.AddComponent<UIHandleParticle>() | ||||
|     //                .Init(par.gameObject).SetScale(1f).SetColor(Color.blue); | ||||
|     //            NewLine(par.transform.parent, par.transform, 0.01f, Color.blue); | ||||
|     //        } | ||||
|     //    } | ||||
|     //    foreach (var rend in transform.GetComponentsInChildren<Renderer>()) | ||||
|     //    { | ||||
|     //        if (rend.transform.parent.GetComponent<UIHandle>() == null) | ||||
|     //        { | ||||
|     //            Renderers.Add(rend); | ||||
|     //            rend.transform.parent.gameObject.layer = 0; | ||||
|     //            rend.transform.parent.gameObject.AddComponent<UIHandleDetachable>() | ||||
|     //                .Init(rend.transform.parent.gameObject).SetScale(1f).SetColor(Color.gray); | ||||
|     //            NewLine(transform, rend.transform.parent, 0.01f, Color.gray); | ||||
|     //            DetachableObjects.Add(rend.transform.gameObject); | ||||
|     //        } | ||||
|     //    } | ||||
|     //} | ||||
|  | ||||
|     //public GameObject DetachObject(int index) | ||||
|     //{ | ||||
|     //    return DetachObject(DetachableObjects[index]); | ||||
|     //} | ||||
|  | ||||
|     //public GameObject DetachObject(GameObject go) | ||||
|     //{ | ||||
|     //    var detached = Instantiate(go); | ||||
|     //    var knobs = detached.GetComponentsInChildren<UIHandle>(); | ||||
|     //    UIHandle knob = null; | ||||
|     //    for (int i = knobs.Length - 1; i >= 0; i--) | ||||
|     //    { | ||||
|     //        knob = knobs[i]; | ||||
|     //        if(knob.GetType() == typeof(UIHandleParticle)) | ||||
|     //        { | ||||
|     //            Destroy(knob.ClearForDeletion()); | ||||
|     //            DestroyImmediate(knob.gameObject); | ||||
|     //        } | ||||
|     //        else | ||||
|     //        { | ||||
|     //            Destroy(knob.ClearForDeletion()); | ||||
|     //        } | ||||
|     //    } | ||||
|     //    var container = detached.AddComponent<KF3StaticContainer>(); | ||||
|     //    detached.transform.position = go.transform.position; | ||||
|     //    detached.transform.rotation = go.transform.rotation; | ||||
|     //    detached.name = go.name + "_Detached"; | ||||
|     //    container.CanBeSaved = false; | ||||
|     //    Destroy(detached.GetComponent<UIHandle>().ClearForDeletion()); | ||||
|     //    knob = detached.AddComponent<UIHandleFurniture>() | ||||
|     //        .Init(detached).SetDefaults(Vector3.zero, Vector3.zero, Vector3.one); | ||||
|     //    var renderers = detached.GetComponentsInChildren<Renderer>().ToList(); | ||||
|     //    renderers.Remove(detached.GetComponent<Renderer>()); | ||||
|     //    foreach (var rend in renderers) | ||||
|     //    { | ||||
|     //        rend.gameObject.layer = 0; | ||||
|     //        rend.gameObject.AddComponent<UIHandleDetachable>() | ||||
|     //            .Init(rend.gameObject).SetColor(Color.gray).SetScale(1).SetName(detached.name + "_part"); | ||||
|     //        rend.enabled = true; | ||||
|     //        //var go2 = container.NewLine(rend.transform, rend.transform.parent, 0.01f, Color.gray); | ||||
|     //        //go2.name = rend.transform.name + " -> " + rend.transform.parent.name; | ||||
|     //    } | ||||
|     //    knob.ScaleReset(); | ||||
|     //    return detached; | ||||
|     //} | ||||
|  | ||||
|     public GameObject NewLine(Transform point1, Transform point2, float width, Color color) | ||||
|     { | ||||
|         if(lineMaterial == null) | ||||
|         { | ||||
|             lineMaterial = new Material(Shader.Find("Legacy Shaders/Particles/Alpha Blended Premultiply")); | ||||
|         } | ||||
|         GameObject go = new GameObject("line"); | ||||
|         go.layer = 5; | ||||
|         go.transform.SetParent(this.transform); | ||||
|         var lr = go.AddComponent<LineRenderer>(); | ||||
|         lr.startWidth = lr.endWidth = width; | ||||
|         lr.startColor = lr.endColor = color; | ||||
|         lr.sharedMaterial = lineMaterial; | ||||
|  | ||||
|         linePoints.Add(go, new Transform[] { point1, point2 }); | ||||
|         return go; | ||||
|     } | ||||
|  | ||||
|     private void Update() | ||||
|     { | ||||
|         foreach (var kv in linePoints) | ||||
|         { | ||||
|             var lr = kv.Key.GetComponent<LineRenderer>(); | ||||
|             for (int i = 0; i < kv.Value.Length; i++) | ||||
|             { | ||||
|                 lr.SetPosition(i, kv.Value[i].position); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void AddMaterialVariant(Renderer renderer, Material[] materialVariant) | ||||
|     { | ||||
|         if (!_materialVariants.ContainsKey(renderer)) | ||||
|         { | ||||
|             _materialVariants.Add(renderer, new List<Material[]>()); | ||||
|         } | ||||
|  | ||||
|         _materialVariants[renderer].Add(materialVariant); | ||||
|     } | ||||
|  | ||||
|     public void SetMaterialVariant(int index) | ||||
|     { | ||||
|         foreach (var keyValue in _materialVariants) | ||||
|         { | ||||
|             keyValue.Key.materials = keyValue.Value[index]; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     protected override void OnDestroy() | ||||
|     { | ||||
|         Destroy(lineMaterial); | ||||
|         foreach(var material in _materialVariants) | ||||
|         { | ||||
|             foreach(var material1 in material.Value) | ||||
|             { | ||||
|                 foreach (var material2 in material1) | ||||
|                 { | ||||
|                     Destroy(material2); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         base.OnDestroy(); | ||||
|     } | ||||
|  | ||||
|     public override void Select() | ||||
|     { | ||||
|         SettingsPanel.gameObject.SetActive(true); | ||||
|     } | ||||
|  | ||||
|     public override void Deselect() | ||||
|     { | ||||
|         SettingsPanel.gameObject.SetActive(false); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3StaticContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Containers/KF3StaticContainer.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 85d6b154ae038604a99d1805754858d9 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										34
									
								
								Assets/KF3/Scripts/Containers/SceneKeyframe.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								Assets/KF3/Scripts/Containers/SceneKeyframe.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| namespace KF3.Containers | ||||
| { | ||||
|     [System.Serializable] | ||||
|     public class SceneKeyframe : KeyframeData | ||||
|     { | ||||
|         public string Stage; | ||||
|         public string Background; | ||||
|  | ||||
|         public SceneKeyframe() { } | ||||
|  | ||||
|         public SceneKeyframe(KF3SceneContainer main) | ||||
|         { | ||||
|             this.Root = null; | ||||
|             this.Stage = main.StageName; | ||||
|             this.Background = main.BackgroundName; | ||||
|         } | ||||
|  | ||||
|         public override KeyframeData Clone() | ||||
|         { | ||||
|             var keyframe = new SceneKeyframe(); | ||||
|             keyframe.Root = null; | ||||
|             keyframe.Stage = this.Stage; | ||||
|             keyframe.Background = this.Background; | ||||
|             return keyframe; | ||||
|         } | ||||
|  | ||||
|         public override KeyframeData Lerp(KeyframeData target1, float amount) | ||||
|         { | ||||
|             var target = target1 as SceneKeyframe; | ||||
|             var copy = this.Clone() as SceneKeyframe; | ||||
|             return copy; | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Containers/SceneKeyframe.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Containers/SceneKeyframe.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: d761685c6e163014f915b5afc1014541 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/CustomPlayableExtensions.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/CustomPlayableExtensions.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| using UnityEngine; | ||||
| using UnityEngine.Playables; | ||||
|  | ||||
| public static class CustomPlayableExtensions | ||||
| { | ||||
|     public static void ResetTime(this Playable playable, float time) | ||||
|     { | ||||
|         playable.SetTime(time); | ||||
|         playable.SetTime(time); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										13
									
								
								Assets/KF3/Scripts/CustomPlayableExtensions.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Assets/KF3/Scripts/CustomPlayableExtensions.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 1d6aadfd4af940c47a915f6e609245bd | ||||
| timeCreated: 1519667576 | ||||
| licenseType: Pro | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										8
									
								
								Assets/KF3/Scripts/Handles.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Assets/KF3/Scripts/Handles.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: b77693a8e9b9801468ec185f1ab291a8 | ||||
| folderAsset: yes | ||||
| DefaultImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										30
									
								
								Assets/KF3/Scripts/Handles/UIHandleCerulean.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								Assets/KF3/Scripts/Handles/UIHandleCerulean.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class UIHandleCerulean : UIHandle | ||||
| { | ||||
|     protected KF3CeruleanContainer mContainer => Owner as KF3CeruleanContainer; | ||||
|  | ||||
|     public static UIHandleCerulean CreateAsChild(KF3ObjectContainer owner) | ||||
|     { | ||||
|         var handle = CreateAsChild<UIHandleCerulean>(owner.transform); | ||||
|         handle.Init(owner).SetColor(Color.yellow).SetScale(1.5f); | ||||
|         return handle; | ||||
|     } | ||||
|  | ||||
|     public override UIHandle Init(ObjectContainer owner) | ||||
|     { | ||||
|         base.Init(owner); | ||||
|  | ||||
|         Popup.AddButton("Reset Position", () => TransformResetPosition()); | ||||
|         Popup.AddButton("Reset Rotation", () => TransformResetRotation()); | ||||
|         Popup.AddButton("Reset Scale", () => TransformResetScale()); | ||||
|         Popup.AddButton("Toggle Physics", () => mContainer.TogglePhysics()); | ||||
|         Popup.AddButton("Toggle Bones", () => mContainer.ToggleBonesVisible(!mContainer.BonesVisible)); | ||||
|         Popup.AddButton("Reset Bones", () => mContainer.ResetBones()); | ||||
|         Popup.AddButton("Delete", () => Destroy(Owner)); | ||||
|  | ||||
|         return this; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Handles/UIHandleCerulean.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Handles/UIHandleCerulean.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: fcc0e948bb20f034e8b7ae8492816bd4 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										52
									
								
								Assets/KF3/Scripts/Handles/UIHandleEyes.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								Assets/KF3/Scripts/Handles/UIHandleEyes.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,52 @@ | ||||
| using UnityEngine; | ||||
|  | ||||
| public class UIHandleEyes : UIHandle | ||||
| { | ||||
|     public static UIHandleEyes Create(KF3FriendContainer owner, Transform head) | ||||
|     { | ||||
|         var handle = new GameObject().AddComponent<UIHandleEyes>(); | ||||
|  | ||||
|         handle.Init(owner, handle.transform) | ||||
|             .SetScale(2) | ||||
|             .SetColor(Color.red); | ||||
|  | ||||
|         handle.name = $"Eyes_{owner.ModelId}"; | ||||
|         handle.transform.localScale = 0.1f * Vector3.one; | ||||
|         handle.transform.SetParent(head); | ||||
|         handle.transform.position = head.position + head.forward; | ||||
|  | ||||
|         return handle; | ||||
|     } | ||||
|  | ||||
|     public override UIHandle Init(ObjectContainer friend) | ||||
|     { | ||||
|         base.Init(friend); | ||||
|         Popup.AddButton("Reset Position", () => LookAtPositionReset()); | ||||
|         Popup.AddButton("Change mode", () => SwapLookAtMode()); | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
|     public override void UpdateManual(Camera camera, bool linesEnabled) | ||||
|     { | ||||
|         base.UpdateManual(camera, linesEnabled); | ||||
|         transform.localEulerAngles = _defaultTransform.Rotation; | ||||
|     } | ||||
|  | ||||
|     void SwapLookAtMode() | ||||
|     { | ||||
|         var mContainer = (KF3FriendContainer)Owner; | ||||
|         if (transform.parent == mContainer.HumanBones[HumanBodyBones.Head]) | ||||
|         { | ||||
|             transform.SetParent(mContainer.Body.transform); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             transform.SetParent(mContainer.HumanBones[HumanBodyBones.Head]); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     void LookAtPositionReset() | ||||
|     { | ||||
|         transform.position = transform.parent.position + Vector3.forward; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Handles/UIHandleEyes.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Handles/UIHandleEyes.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 60bfe8cf0d5fae34fb9d3ba5ba2306b8 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										38
									
								
								Assets/KF3/Scripts/Handles/UIHandleFriend.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								Assets/KF3/Scripts/Handles/UIHandleFriend.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| using UnityEngine; | ||||
|  | ||||
| public class UIHandleFriend : UIHandle | ||||
| { | ||||
|     protected KF3FriendContainer mContainer => Owner as KF3FriendContainer; | ||||
|  | ||||
|     public static UIHandleFriend CreateAsChild(KF3ObjectContainer owner) | ||||
|     { | ||||
|         var handle = CreateAsChild<UIHandleFriend>(owner.transform); | ||||
|         handle.Init(owner).SetColor(Color.yellow).SetScale(1.5f); | ||||
|         return handle; | ||||
|     } | ||||
|  | ||||
|     public override UIHandle Init(ObjectContainer owner) | ||||
|     { | ||||
|         base.Init(owner); | ||||
|  | ||||
|         Popup.AddButton("Reset All", TransformResetAll); | ||||
|         Popup.AddButton("Reset Position", TransformResetPosition); | ||||
|         Popup.AddButton("Reset Rotation", TransformResetRotation); | ||||
|         Popup.AddButton("Reset Scale", TransformResetScale); | ||||
|         Popup.AddButton("Toggle Physics", () => | ||||
|         { | ||||
|             mContainer.TogglePhysics(); | ||||
|             mContainer.SetKeyframe(); | ||||
|         }); | ||||
|         Popup.AddButton("Toggle Bones", () => mContainer.ToggleBonesVisible(!mContainer.BonesVisible)); | ||||
|         Popup.AddButton("Toggle IK", () => { | ||||
|             mContainer.ToggleIK(!mContainer.IKEnabled); | ||||
|             mContainer.SetKeyframe(); | ||||
|         }); | ||||
|         Popup.AddButton("Reset Bones", () => mContainer.ResetBones()); | ||||
|         Popup.AddButton("Delete", () => Destroy(Owner)); | ||||
|  | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Handles/UIHandleFriend.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Handles/UIHandleFriend.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 2dd174b81dfa2fb47b2abf859285ec7f | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										30
									
								
								Assets/KF3/Scripts/KF3AssetBundle.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								Assets/KF3/Scripts/KF3AssetBundle.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| using System; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using UnityEngine; | ||||
|  | ||||
| //[System.Serializable] | ||||
| public class KF3AssetBundle | ||||
| { | ||||
|     public string DisplayName; | ||||
|     public string FileName; | ||||
|     public string FullPath; | ||||
|  | ||||
|     public int IdNum; | ||||
|     public string IdStr; | ||||
|  | ||||
|     public KF3AssetBundle(string bundleName) | ||||
|     { | ||||
|         DisplayName = Path.GetFileName(bundleName); | ||||
|         FileName = bundleName; | ||||
|         FullPath = Path.Combine(Settings.AssetsDirectory, bundleName); | ||||
|     } | ||||
|  | ||||
|     public KF3AssetBundle(string displayName, string bundleName) | ||||
|     { | ||||
|         DisplayName = displayName; | ||||
|         FileName = bundleName; | ||||
|         FullPath = Path.Combine(Settings.AssetsDirectory, bundleName); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/KF3AssetBundle.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/KF3AssetBundle.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 71c45231b7370ae4ea6c1acb050b2147 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										339
									
								
								Assets/KF3/Scripts/KF3AssetLibrary.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										339
									
								
								Assets/KF3/Scripts/KF3AssetLibrary.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,339 @@ | ||||
| using System; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.IO.Compression; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class KF3AssetLibrary : AssetLibrary | ||||
| { | ||||
|     public List<CharaData> CharaData = new List<CharaData>(); | ||||
|     public List<KF3AssetBundle> AssetBundles = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Characters = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Animations = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> AnimationSets = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Ceruleans = new List<KF3AssetBundle>(); | ||||
|     public Dictionary<string, List<KF3AssetBundle>> CeruleansD = new Dictionary<string, List<KF3AssetBundle>>(); | ||||
|     public List<KF3AssetBundle> CeruleanAnimationSets = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Effects = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Furniture = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Icons = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Miracles = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Skies = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Stages = new List<KF3AssetBundle>(); | ||||
|     public List<KF3AssetBundle> Misc = new List<KF3AssetBundle>(); | ||||
|  | ||||
|     public static KF3AssetLibrary Instance => GetInstance<KF3AssetLibrary>(); | ||||
|  | ||||
|     public IEnumerator Init() | ||||
|     { | ||||
|         _mainInstance = this; | ||||
|  | ||||
|         string charaData = LoadGzipFile("CHARA_DATA"); | ||||
|         if (charaData != "error") | ||||
|         { | ||||
|             Error.Log(Color.green, "Loaded Chara_Data from KF3 cache"); | ||||
|             CharaData = JsonHelper.getJsonArray<CharaData>(charaData).ToList(); | ||||
|         } | ||||
|  | ||||
|         KF3Names.LoadCeruleanNames(); | ||||
|          | ||||
|         if (GetComponent<KF3ModelViewerMain>().IsOnline) | ||||
|         { | ||||
|             yield return GetAbList(); | ||||
|         } | ||||
|         if (AssetBundles.Count <= 0) | ||||
|         { | ||||
|             Error.Log(Color.red, "Failed to load ab_list.txt"); | ||||
|         } | ||||
|         yield break; | ||||
|     } | ||||
|  | ||||
|     public string LoadGzipFile(string fileName) | ||||
|     { | ||||
|         string openFile = Path.Combine(Settings.CacheDirectory, "CHARA_DATA.d"); | ||||
|         if (!File.Exists(openFile)) { Error.Log(Color.blue, "CHARA_DATA cache file not found, character names may be outdated"); return "error"; } | ||||
|         using (Stream decompress = new GZipStream(File.OpenRead(openFile), CompressionMode.Decompress)) | ||||
|         using (StreamReader stringWriter = new StreamReader(decompress)) | ||||
|         { | ||||
|             return stringWriter.ReadToEnd(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private IEnumerator GetAbList() | ||||
|     { | ||||
|         //LOAD GAME VERSION | ||||
|         Error.Log(Color.green, $"Game Version is {Settings.GameVersion}"); | ||||
|  | ||||
|         //LOAD ASSETS URL | ||||
|         Error.Log(Color.green, $"Assets server address is: {Settings.AssetsUrl}"); | ||||
|  | ||||
|         //LOAD AB_LIST | ||||
|         string filePath = Path.Combine(Settings.AssetListDirectory, "ab_list.txt"); | ||||
|         if (File.Exists(filePath)) | ||||
|         { | ||||
|             LoadText(File.ReadAllText(filePath)); | ||||
|             Error.Log(Color.green, $"Loaded ab file from {filePath}"); | ||||
|         } | ||||
|         else if (KF3ModelViewerMain.Instance.IsOnline) | ||||
|         { | ||||
|             WWW www = new WWW(Settings.AssetsUrl + "/Windows/1.0.0/ja/ab_list.txt"); | ||||
|             yield return www; | ||||
|             string response = www.text; | ||||
|             if (!string.IsNullOrEmpty(response)) | ||||
|             { | ||||
|                 LoadText(response); | ||||
|                 Error.Log(Color.green, $"ab file downloaded"); | ||||
|                 File.WriteAllText(filePath, response); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 Error.Log(Color.red, $"Failed to load ab file"); | ||||
|             } | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Error.Log(Color.red, $"Failed to load ab file"); | ||||
|         } | ||||
|  | ||||
|         //Load loose assets | ||||
|         foreach(var fileName in Directory.GetFiles(Settings.LooseAssetsDirectory)) | ||||
|         { | ||||
|             string name = Path.GetFullPath(fileName); | ||||
|             KF3AssetBundle bundle = new KF3AssetBundle(Path.GetFileName(name)); | ||||
|             bundle.FullPath = name; | ||||
|             AddToCategory(bundle, bundle.DisplayName); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public KF3AssetBundle Find(string fileName) | ||||
|     { | ||||
|         return AssetBundles.FirstOrDefault(ab => ab.FileName == fileName); | ||||
|     } | ||||
|  | ||||
|     public IEnumerator LoadAsset(KF3AssetBundle bundle, Action<AssetBundle> callback) | ||||
|     { | ||||
|         if(bundle == null) | ||||
|         { | ||||
|             callback?.Invoke(null); | ||||
|             yield break; | ||||
|         } | ||||
|         if (File.Exists(bundle.FullPath)) | ||||
|         { | ||||
|             callback?.Invoke(AssetBundle.LoadFromFile(bundle.FullPath)); | ||||
|             yield break; | ||||
|         } | ||||
|         else if (KF3ModelViewerMain.Instance.IsOnline) | ||||
|         { | ||||
|             AssetBundle assetBundle = null; | ||||
|             yield return DownloadAssetBundle(bundle, (ab) => | ||||
|             { | ||||
|                 assetBundle = ab; | ||||
|             }); | ||||
|             if(assetBundle != null) | ||||
|             { | ||||
|                 callback?.Invoke(assetBundle); | ||||
|                 yield break; | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 callback?.Invoke(null); | ||||
|                 yield break; | ||||
|             } | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Error.Log(Color.yellow, $"{bundle.FileName} Does not exist"); | ||||
|             callback?.Invoke(null); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public IEnumerator DownloadAssetBundle(KF3AssetBundle bundle, System.Action<AssetBundle> callback) | ||||
|     { | ||||
|         string saveTo = bundle.FullPath; | ||||
|         string url = Settings.AssetsUrl + "/Windows/1.0.0/ja/assets/" + bundle.FileName; | ||||
|  | ||||
|         Error.Log($"Downloading\n{url}\nto\n{saveTo}", Color.blue); | ||||
|  | ||||
|         WWW www = new WWW(url); | ||||
|         yield return www; | ||||
|         if (!string.IsNullOrEmpty(www.error)) | ||||
|         { | ||||
|             Error.Log(Color.red, www.error); | ||||
|             www.Dispose(); | ||||
|             callback(null); | ||||
|             yield break; | ||||
|         } | ||||
|         byte[] bytes = www.bytes; | ||||
|         Directory.CreateDirectory(Path.GetDirectoryName(saveTo)); | ||||
|         File.WriteAllBytes(saveTo, bytes); | ||||
|         www.Dispose(); | ||||
|         Error.Log(Color.green, $"Download Successful"); | ||||
|         callback(AssetBundle.LoadFromFile(saveTo)); | ||||
|     } | ||||
|  | ||||
|     /// <summary> | ||||
|     /// Load AssetBundle list | ||||
|     /// </summary> | ||||
|     private void LoadText(string abListTxt) | ||||
|     { | ||||
|         int loaded = 0; | ||||
|         int total = 0; | ||||
|         using (StringReader reader = new StringReader(abListTxt)) | ||||
|         { | ||||
|             while (reader.Peek() >= 0) | ||||
|             { | ||||
|                 total++; | ||||
|                 string line = reader.ReadLine(); | ||||
|                 if (string.IsNullOrEmpty(line)) | ||||
|                 { | ||||
|                     continue; | ||||
|                 } | ||||
|                 loaded++; | ||||
|                 string[] temp = line.Split(new string[] { " ", "\t" }, StringSplitOptions.RemoveEmptyEntries); | ||||
|                 string bundleName = temp[0]; | ||||
|  | ||||
|                 KF3AssetBundle bundle = new KF3AssetBundle(bundleName); | ||||
|  | ||||
|                 AddToCategory(bundle, bundleName); | ||||
|             } | ||||
|         } | ||||
|         Error.Log(Color.green, $"Loaded {loaded}/{total} AB lines"); | ||||
|     } | ||||
|  | ||||
|     private void AddToCategory(KF3AssetBundle bundle, string bundleName) | ||||
|     { | ||||
|         //add to global list | ||||
|         AssetBundles.Add(bundle); | ||||
|  | ||||
|         //add to characters list | ||||
|         if (bundleName.StartsWith("ch_") && bundleName.EndsWith("_a.prefab")) | ||||
|         { | ||||
|             bundle.IdStr = bundleName.Split('_', '.')[1]; | ||||
|             bundle.IdNum = int.Parse(bundle.IdStr); | ||||
|             if (bundle.IdNum < 10000) | ||||
|             { | ||||
|                 Characters.Add(bundle); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 bundle.DisplayName = KF3Names.GetEnemyName(bundle.IdNum); | ||||
|                 Ceruleans.Add(bundle); | ||||
|                 if (CeruleansD.ContainsKey(bundle.DisplayName)) | ||||
|                 { | ||||
|                     CeruleansD[bundle.DisplayName].Add(bundle); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     CeruleansD.Add(bundle.DisplayName, new List<KF3AssetBundle>() { bundle }); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         else if (bundleName.StartsWith("icon_")) | ||||
|         { | ||||
|             Icons.Add(bundle); | ||||
|         } | ||||
|         else if (bundleName.StartsWith("captainroom_")) | ||||
|         { | ||||
|             bundle.DisplayName = bundle.DisplayName.Replace("captainroom_obj_", "").Replace("_mdl.prefab", ""); | ||||
|             Furniture.Add(bundle); | ||||
|         } | ||||
|         else if (bundleName.StartsWith("ch_") && bundleName.EndsWith("_mot.prefab")) | ||||
|         { | ||||
|             bundle.IdStr = bundleName.Split('_', '.')[1]; | ||||
|             bundle.IdNum = int.Parse(bundle.IdStr); | ||||
|             Animations.Add(bundle); | ||||
|             if (bundleName.EndsWith("a_mot.prefab")) | ||||
|             { | ||||
|                 if (bundle.IdNum < 10000) | ||||
|                 { | ||||
|                     bundle.DisplayName = bundle.IdStr + "_" + KF3Names.GetCharaName(bundle.IdNum); | ||||
|                     AnimationSets.Add(bundle); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     bundle.DisplayName = KF3Names.GetEnemyName(bundle.IdNum); | ||||
|                     CeruleanAnimationSets.Add(bundle); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         else if (bundleName.StartsWith("st_")) | ||||
|         { | ||||
|             Stages.Add(bundle); | ||||
|         } | ||||
|         else if (bundleName.StartsWith("sky_")) | ||||
|         { | ||||
|             Skies.Add(bundle); | ||||
|         } | ||||
|         else if (bundleName.StartsWith("ef_auth")) | ||||
|         { | ||||
|             bundle.DisplayName = bundleName.Replace("ef_auth", ""); | ||||
|             Miracles.Add(bundle); | ||||
|         } | ||||
|         else if (bundleName.StartsWith("ef_")) | ||||
|         { | ||||
|             Effects.Add(bundle); | ||||
|             Misc.Add(bundle); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /// <summary> | ||||
|     /// Get a list of costumes from selected character id | ||||
|     /// </summary> | ||||
|     public List<KF3AssetBundle> GetCostumesFromId(int id) | ||||
|     { | ||||
|         if (id > 9999) | ||||
|         { | ||||
|             id = id / 10; | ||||
|             return AssetBundles.Where(k => k.FileName.StartsWith($"ch_{id.ToString().PadLeft(4, '0')}") && !k.FileName.Contains("mot") && k.FileName.Split(new char[] { '.', '_' }).Length == 4) | ||||
|                 .ToList().ConvertAll(o=>(KF3AssetBundle)o); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             return AssetBundles.Where(k => k.FileName.StartsWith($"ch_{id.ToString().PadLeft(4, '0')}") && !k.FileName.Contains("mot") && k.FileName.Split(new char[] { '.', '_' }).Length == 4) | ||||
|                 .ToList().ConvertAll(o => (KF3AssetBundle)o); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public KF3AssetBundle GetAnimationSet(string name) | ||||
|     { | ||||
|         if(int.TryParse(name.Split('_','.')[1], out int id)){ | ||||
|             return GetAnimationSet(id); | ||||
|         } | ||||
|         return (KF3AssetBundle)AnimationSets.FirstOrDefault(a => a.DisplayName == name || a.FileName == name); | ||||
|     } | ||||
|  | ||||
|     public KF3AssetBundle GetAnimationSet(int id) | ||||
|     { | ||||
|         return (KF3AssetBundle)AnimationSets.FirstOrDefault(a => int.Parse(a.FileName.Split('_', '.')[1]) == id); | ||||
|     } | ||||
|  | ||||
|     public List<KF3AssetBundle> GetMisc() | ||||
|     { | ||||
|         return Misc.ConvertAll(k=>(KF3AssetBundle)k); | ||||
|     } | ||||
|  | ||||
|     public List<KF3AssetBundle> GetMiracles() | ||||
|     { | ||||
|         return Miracles.ConvertAll(k => (KF3AssetBundle)k); | ||||
|     } | ||||
|  | ||||
|     public List<KF3AssetBundle> GetCeruleans(string name) | ||||
|     { | ||||
|         return CeruleansD[name]; | ||||
|     } | ||||
|  | ||||
|     public KF3AssetBundle GetFurnitureBundle(string bundleName) | ||||
|     { | ||||
|         return (KF3AssetBundle)Furniture.FirstOrDefault(a => a.DisplayName == bundleName || a.FileName == bundleName); | ||||
|     } | ||||
|     public KF3AssetBundle GetMiscBundle(string bundleName) | ||||
|     { | ||||
|         return (KF3AssetBundle)Misc.FirstOrDefault(a => a.DisplayName == bundleName || a.FileName == bundleName); | ||||
|     } | ||||
|     public KF3AssetBundle GetMiracleBundle(string bundleName) | ||||
|     { | ||||
|         return (KF3AssetBundle)Miracles.FirstOrDefault(a => a.DisplayName == bundleName || a.FileName == bundleName); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/KF3AssetLibrary.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/KF3AssetLibrary.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 373c79c99278cfd49831aa3dfee6c833 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										197
									
								
								Assets/KF3/Scripts/KF3ModelBuilder.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										197
									
								
								Assets/KF3/Scripts/KF3ModelBuilder.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,197 @@ | ||||
| using RuntimeGizmos; | ||||
| using System; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
| using UnityEngine.UI; | ||||
|  | ||||
| public class KF3ModelBuilder : ModelBuilder | ||||
| { | ||||
|     public static KF3ModelBuilder Instance => GetInstance<KF3ModelBuilder>(); | ||||
|  | ||||
|     private KF3ModelViewerMain Main => KF3ModelViewerMain.Instance; | ||||
|  | ||||
|     public IEnumerator Init(Action<KF3ModelBuilder> callback) | ||||
|     { | ||||
|         callback(this); | ||||
|         yield break; | ||||
|     } | ||||
|  | ||||
|     public IEnumerator BuildCharacter(string modelName, string animSetName, Action<GameObject> callback = null) | ||||
|     { | ||||
|         yield return KF3FriendContainer.CreateAsync(modelName, animSetName, false, (container)=> | ||||
|         { | ||||
|             Main.SelectObject(container); | ||||
|             callback?.Invoke(container.gameObject); | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     public IEnumerator BuildCerulean(string modelName, string animSetName, Action<GameObject> callback = null) | ||||
|     { | ||||
|         yield return KF3CeruleanContainer.CreateAsync(modelName, animSetName, (container) => | ||||
|         { | ||||
|             Main.SelectObject(container); | ||||
|             callback?.Invoke(container.gameObject); | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     public override IEnumerator SpawnSerializedCoroutine(ObjectContainerSerializable oc, Action<ObjectContainer> callback = null) | ||||
|     { | ||||
|         return SpawnSerialized(oc as KF3ObjectContainerSerializable, callback); | ||||
|     } | ||||
|  | ||||
|     public IEnumerator SpawnSerialized(KF3ObjectContainerSerializable oc, Action<ObjectContainer> callback = null) | ||||
|     { | ||||
|         switch (oc) | ||||
|         { | ||||
|             case KF3CharacterContainerSerializable cs: | ||||
|                 if (cs.IsCerulean) | ||||
|                 { | ||||
|                     var celName = Main.Assets.Ceruleans.FirstOrDefault(c => c.FileName == cs.CostumeName); | ||||
|                     yield return BuildCerulean(celName.FileName, celName.FileName, (go) => | ||||
|                     { | ||||
|                         var cont = go.GetComponent<KF3CeruleanContainer>(); | ||||
|                         cont.PasteContainer(cs, new PoseLoadOptions(true)); | ||||
|                         cont.DeserializeFrames(cs); | ||||
|                         TimelineController.SetCurrentFrame(cont); | ||||
|                         callback?.Invoke(cont); | ||||
|                     }); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     yield return BuildCharacter(cs.CostumeName, cs.AnimationName, (go) => | ||||
|                     { | ||||
|                         var cont = go.GetComponent<KF3FriendContainer>(); | ||||
|                         cont.PasteContainer(cs, new PoseLoadOptions(true)); | ||||
|                         cont.DeserializeFrames(cs); | ||||
|                         TimelineController.SetCurrentFrame(cont); | ||||
|                         callback?.Invoke(cont); | ||||
|                     }); | ||||
|                 } | ||||
|                 break; | ||||
|             case KF3ObjectContainerSerializable cs: | ||||
|                 yield return SpawnFurniture(cs.Filename); | ||||
|                 break; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public IEnumerator UpdateCharacter(KF3CharacterContainer container, string modelName, string animSetName, Action<ObjectContainer> callback = null) | ||||
|     { | ||||
|         if (container.LoadInProgress) yield break; | ||||
|  | ||||
|         string mIdLong = modelName.Split('_', '.')[1]; | ||||
|         string aIdLong = animSetName.Split('_', '.')[1]; | ||||
|  | ||||
|         container.ModelId = int.Parse(mIdLong); | ||||
|         container.CostumeName = modelName; | ||||
|         container.AnimationName = animSetName; | ||||
|  | ||||
|         var data = container.Serialize() as KF3CharacterContainerSerializable; | ||||
|         Destroy(container); | ||||
|         yield return SpawnSerialized(data, callback); | ||||
|     } | ||||
|  | ||||
|     public void SpawnReference(Texture2D texture, System.Action<GameObject> callback = null) | ||||
|     { | ||||
|         //GameObject go = new GameObject(texture.name); | ||||
|         //go.AddComponent<UIHandleReference>().Init(go); | ||||
|         //GameObject go1 = GameObject.CreatePrimitive(PrimitiveType.Plane); | ||||
|         //go1.transform.SetParent(go.transform); | ||||
|         //go1.Get<Renderer>().material.shader = Shader.Find("Unlit/Transparent Cutout"); | ||||
|         //go1.Get<Renderer>().material.mainTexture = texture; | ||||
|         //go1.transform.localScale = new Vector3((float)texture.width / 5000, 1, (float)texture.height / 5000); | ||||
|  | ||||
|         //callback?.Invoke(go); | ||||
|     } | ||||
|  | ||||
|     public IEnumerator SpawnAsset(string text, System.Action<GameObject> callback) | ||||
|     { | ||||
|         KF3AssetBundle assetBundle = Main.Assets.Find(text); | ||||
|  | ||||
|         yield return Main.Assets.LoadAsset(assetBundle, (ab) => | ||||
|         { | ||||
|             var background = Instantiate(ab.LoadAsset(ab.GetAllAssetNames()[0])) as GameObject; | ||||
|             ab.Unload(false); | ||||
|             callback?.Invoke(background); | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     public IEnumerator SpawnFurniture(string bundleName, System.Action<GameObject> callback = null) | ||||
|     { | ||||
|         KF3AssetBundle assetBundle = Main.Assets.GetFurnitureBundle(bundleName); | ||||
|         if(assetBundle != null) | ||||
|         { | ||||
|             yield return Main.Assets.LoadAsset(assetBundle, (ab) => | ||||
|             { | ||||
|                 KF3StaticContainer containter = KF3StaticContainer.Create(ab); | ||||
|                 callback?.Invoke(containter.gameObject); | ||||
|             }); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             assetBundle = Main.Assets.GetMiscBundle(bundleName); | ||||
|             if (assetBundle == null) assetBundle = assetBundle = Main.Assets.GetMiracleBundle(bundleName); | ||||
|             if (assetBundle != null) | ||||
|             { | ||||
|                 yield return Spawn(assetBundle); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public IEnumerator Spawn(KF3AssetBundle assetBundle, System.Action<GameObject> callback = null) | ||||
|     { | ||||
|         yield return Main.Assets.LoadAsset(assetBundle, (ab) => | ||||
|         { | ||||
|             GameObject go = Instantiate(ab.LoadAsset(ab.GetAllAssetNames()[0]) as GameObject); | ||||
|             go.layer = 0; | ||||
|  | ||||
|             KF3StaticContainer containter = go.AddComponent<KF3StaticContainer>(); | ||||
|             //containter.oName = assetBundle.DisplayName; | ||||
|             UIHandleProp.CreateAsChild(containter, go.transform); | ||||
|  | ||||
|             //containter.PauseAll(); | ||||
|             //containter.BuildHierarchy(); | ||||
|  | ||||
|             ab.Unload(false); | ||||
|             callback?.Invoke(go); | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     /// <summary> Clean Up, delete all model remains </summary> | ||||
|     public void DeleteAnimation(KF3CharacterContainer container) | ||||
|     { | ||||
|         List<GameObject> destroyQueue = new List<GameObject>() | ||||
|         { | ||||
|             container.BodyAnimation.gameObject | ||||
|         }; | ||||
|  | ||||
|         List<object> nullable = new List<object>() | ||||
|         { | ||||
|             container.BodySimpleAnimation | ||||
|         }; | ||||
|  | ||||
|         if(container as KF3FriendContainer != null) | ||||
|         { | ||||
|             var container1 = (KF3FriendContainer)container; | ||||
|             destroyQueue.Add(container1.EarsAnimation.gameObject); | ||||
|             destroyQueue.Add(container1.TailAnimation.gameObject); | ||||
|             nullable.Add(container1.EarsSimpleAnimation); | ||||
|             nullable.Add(container1.TailSimpleAnimation); | ||||
|         } | ||||
|  | ||||
|         for (int i = destroyQueue.Count - 1; i >= 0; i--) | ||||
|         { | ||||
|             Destroy(destroyQueue[i]); | ||||
|         } | ||||
|  | ||||
|         for (int i = nullable.Count - 1; i >= 0; i--) | ||||
|         { | ||||
|             nullable[i] = null; | ||||
|         } | ||||
|  | ||||
|         Resources.UnloadUnusedAssets(); | ||||
|         System.GC.Collect(); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/KF3ModelBuilder.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/KF3ModelBuilder.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: eb8423da904bf2141920bdc3b0f113ac | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										138
									
								
								Assets/KF3/Scripts/KF3ModelViewerInterface.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										138
									
								
								Assets/KF3/Scripts/KF3ModelViewerInterface.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,138 @@ | ||||
| using System; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
| using UnityEngine.UI; | ||||
| using static UnityEngine.EventSystems.EventTrigger; | ||||
| using static UnityEngine.GraphicsBuffer; | ||||
|  | ||||
| public class KF3ModelViewerInterface : ModelViewerInterface | ||||
| { | ||||
|     public bool HandlesVisible = true; | ||||
|     public static KF3ModelViewerInterface Instance => GetInstance<KF3ModelViewerInterface>(); | ||||
|  | ||||
|     [Header("Current")] | ||||
|     public Transform Timeline; | ||||
|     public UIPopupMessage PopupMessagePrefab; | ||||
|     public Transform HandlesPanel; | ||||
|  | ||||
|     public KF3.UI.Panels.SpawnPanel SpawnPanel; | ||||
|  | ||||
|     [Header("Obsolete")] | ||||
|     public ScrollRect SelectionToggle; | ||||
|  | ||||
|     public GameObject LightPanel; | ||||
|  | ||||
|     public InputField WidthInput, HeightInput; | ||||
|  | ||||
|     private GUIStyle _style = new GUIStyle(); | ||||
|  | ||||
|     private KF3ModelViewerMain Main => KF3ModelViewerMain.Instance; | ||||
|  | ||||
|     private IEnumerator Start() | ||||
|     { | ||||
|         _mainInstance = this; | ||||
|  | ||||
|         while(KF3ModelViewerMain.Instance == null || KF3AssetLibrary.Instance == null) | ||||
|         { | ||||
|             yield return 0; | ||||
|         } | ||||
|  | ||||
|         _style.normal.textColor = Color.white; | ||||
|  | ||||
|         FindControls(); | ||||
|         StartCoroutine(SpawnPanel.LoadAll(Main)); | ||||
|         TooltipLabels[0].transform.parent.gameObject.SetActive(Settings.Instance.showHints); | ||||
|     } | ||||
|  | ||||
|     private void OnGUI() | ||||
|     { | ||||
|         if (ModelViewerMain.GetInstance() == null) return; | ||||
|         if (Settings.Instance.showHints) | ||||
|         { | ||||
|             int fontSize = Mathf.Clamp((int)(15.0f * ((float)Screen.height / (float)1080)), 10, int.MaxValue); | ||||
|             _style.fontSize = fontSize; | ||||
|             int n = 2; | ||||
|             float height = Mathf.Clamp((int)(18.0f * ((float)Screen.height / (float)1080)), 12, int.MaxValue); | ||||
|             GUI.Label(new Rect(10, n++ * height, 100, height), "E - open spawn menu", _style); | ||||
|             switch (Main.GetCameraHandler().Settings.CameraMode) | ||||
|             { | ||||
|                 case 0: | ||||
|                 case 1: | ||||
|                     GUI.Label(new Rect(10, n++ * height, 100, height), "WASD - move camera (alt)", _style); | ||||
|                     GUI.Label(new Rect(10, n++ * height, 100, height), "LMB + mouse move - move camera", _style); | ||||
|                     GUI.Label(new Rect(10, n++ * height, 100, height), "RMB + mouse move - move sun", _style); | ||||
|                     GUI.Label(new Rect(10, n++ * height, 100, height), "MMB + mouse up/down - camera target height", _style); | ||||
|                     GUI.Label(new Rect(10, n++ * height, 100, height), "LMB + mouse scroll - camera distance", _style); | ||||
|                     break; | ||||
|                 case 2: | ||||
|                     GUI.Label(new Rect(10, n++ * height, 100, height), "LMB + WASD - move camera", _style); | ||||
|                     GUI.Label(new Rect(10, n++ * height, 100, height), "RMB + WASD - pan camera", _style); | ||||
|                     break; | ||||
|             } | ||||
|             if (Main.SelectedObject) | ||||
|             { | ||||
|                 GUI.Label(new Rect(10, n++ * height, 100, height), "Arrow Keys - change animation speed", _style); | ||||
|                 GUI.Label(new Rect(10, n++ * height, 100, height), "Spacebar - pause/play animation", _style); | ||||
|                 GUI.Label(new Rect(10, n++ * height, 100, height), "Ctrl + LMB - move invisibly", _style); | ||||
|             } | ||||
|             GUI.Label(new Rect(10, n++ * height, 100, height), "H - hide this", _style); | ||||
|         } | ||||
|         if (Main.GetCameraHandler() == Main.WorkCameraOrbit) | ||||
|         { | ||||
|             var centeredStyle = GUI.skin.GetStyle("Label"); | ||||
|             centeredStyle.alignment = TextAnchor.UpperCenter; | ||||
|             GUI.Label(new Rect(Screen.width / 2 - 50, Screen.height / 2 - 25, 100, 50), "USING WORK CAMERA", centeredStyle); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void FixedUpdate() | ||||
|     { | ||||
|         if (KF3ModelViewerMain.Instance == null) return; | ||||
|         if (Main.SelectedObject != null && Main.SelectedObject.GetDataType() == DataType.Character) | ||||
|         { | ||||
|             var simpleAnim = Main.GetSelectedObject<KF3ObjectContainer>().AsCharacter.BodySimpleAnimation; | ||||
|             if (simpleAnim != null && simpleAnim.clip != null) | ||||
|             { | ||||
|                 SimpleAnimation.State currentClip = simpleAnim.GetStates().FirstOrDefault(state => state.clip == simpleAnim.clip); | ||||
|                 //TimeScaleText.text = Strings.TimeScaleString + currentClip.speed.ToString("F2"); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void FindControls() | ||||
|     { | ||||
|         WidthInput.text = Screen.width.ToString(); | ||||
|         HeightInput.text = Screen.height.ToString(); | ||||
|     } | ||||
|  | ||||
|     public void OnSceneDelete() | ||||
|     { | ||||
|         Main.EmptyScene<KF3SceneContainer>(); | ||||
|     } | ||||
|  | ||||
|     public void SelectionAdd(Transform entry) | ||||
|     { | ||||
|         var go = Instantiate(Main.Resources.SelectionEntry, SelectionToggle.content.transform); | ||||
|         go.SetTarget(entry); | ||||
|     } | ||||
|  | ||||
|     public void SelectionRemove(Transform target) | ||||
|     { | ||||
|         var entry = SelectionToggle.content.transform.GetComponentsInChildren<UISelectionEntry>().FirstOrDefault(c => c.Target == target); | ||||
|         if(entry != null) | ||||
|         { | ||||
|             Destroy(entry); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void SelectionClear() | ||||
|     { | ||||
|         if (SelectionToggle.content == null) return; | ||||
|         for (int i = SelectionToggle.content.transform.childCount - 1; i >= 0; i--) | ||||
|         { | ||||
|             DestroyImmediate(SelectionToggle.content.transform.GetChild(i).gameObject); | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/KF3ModelViewerInterface.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/KF3ModelViewerInterface.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: e6d93901e0c9dc145a55438241b04761 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										139
									
								
								Assets/KF3/Scripts/KF3ModelViewerMain.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										139
									
								
								Assets/KF3/Scripts/KF3ModelViewerMain.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,139 @@ | ||||
| using KF3; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class KF3ModelViewerMain : ModelViewerMain | ||||
| { | ||||
|     public float SpecialDistance = 1; | ||||
|     public bool IsOnline = true; | ||||
|     public static KF3ModelViewerMain Instance => GetInstance<KF3ModelViewerMain>(); | ||||
|  | ||||
|     public KF3ModelViewerInterface UI => ModelViewerInterface.GetInstance<KF3ModelViewerInterface>(); | ||||
|     public KF3AssetLibrary Assets => AssetLibrary.GetInstance<KF3AssetLibrary>(); | ||||
|     public KF3ModelBuilder Builder => ModelBuilder.GetInstance<KF3ModelBuilder>(); | ||||
|     public AdditionalResources Resources => SharedResources.Instance as AdditionalResources; | ||||
|     public AnimationClip OverrideClip; | ||||
|  | ||||
|     protected override void Awake() | ||||
|     { | ||||
|         Debug.LogError("Fix this"); | ||||
|         Settings.Load(); | ||||
|         _backupTimers = _backupTimes.ToArray(); | ||||
|     } | ||||
|  | ||||
|     private IEnumerator Start() | ||||
|     { | ||||
|         Application.targetFrameRate = 30; | ||||
|         Error.Log(Color.green, "Viewer version: " + Application.version); | ||||
|  | ||||
|         float warningTimer = 0; | ||||
|  | ||||
|         yield return GetComponent<KF3AssetLibrary>().Init(); | ||||
|         while (KF3ModelBuilder.Instance == null || KF3ModelViewerInterface.Instance == null || SharedResources.Instance == null) | ||||
|         { | ||||
|             warningTimer += Time.deltaTime; | ||||
|             if (warningTimer > 2) | ||||
|             { | ||||
|                 warningTimer = 0; | ||||
|                 string report = $"AssetLibrary: {KF3AssetLibrary.Instance != null}\nModelBuilder: {KF3ModelBuilder.Instance != null}\nInterface: {KF3ModelViewerInterface.Instance != null}\nResources: {SharedResources.Instance != null}"; | ||||
|                 Error.Log(report, Color.red); | ||||
|             } | ||||
|             yield return 0; | ||||
|         } | ||||
|  | ||||
|         _mainInstance = this; | ||||
|         CurrentScene = SceneContainer.Create<KF3SceneContainer>(this); | ||||
|          | ||||
|         KF3ModelViewerInterface.SetDropdownData(GetCurrentScene<KF3SceneContainer>().Settings.StageDropdown, KF3ModelViewerMain.Instance.Assets.Stages.Select(s => s.DisplayName).ToList(), true); | ||||
|         KF3ModelViewerInterface.SetDropdownData(GetCurrentScene<KF3SceneContainer>().Settings.BackgroundDropdown, KF3ModelViewerMain.Instance.Assets.Skies.Select(s => s.DisplayName).ToList(), true); | ||||
|     } | ||||
|  | ||||
|     private void Update() | ||||
|     { | ||||
|         AutoSaveUpdate(); | ||||
|     } | ||||
|  | ||||
|     public override void SelectionClear() | ||||
|     { | ||||
|         base.SelectionClear(); | ||||
|         KF3ModelViewerInterface.Instance.SelectionClear(); | ||||
|     } | ||||
|  | ||||
|     public static void DisposeOf(GameObject go) | ||||
|     { | ||||
|         if (go == null) return; | ||||
|         var rends = go.GetComponentsInChildren<Renderer>(); | ||||
|         foreach(var rend in rends) | ||||
|         { | ||||
|             for(int i=rend.materials.Length-1; i>=0; i--) | ||||
|             { | ||||
|                 Destroy(rend.materials[i]); | ||||
|             } | ||||
|         } | ||||
|         Destroy(go); | ||||
|         UnityEngine.Resources.UnloadUnusedAssets(); | ||||
|         System.GC.Collect(); | ||||
|     } | ||||
|  | ||||
|     public override IEnumerator LoadScene(SceneSerializable bc) | ||||
|     { | ||||
|         Debug.Log("Emptying scene"); | ||||
|         EmptyScene<KF3SceneContainer>(); | ||||
|  | ||||
|         foreach (var c in bc.Objects) | ||||
|         { | ||||
|             Debug.Log($"Loading {c.Filename} {c.GUID} {c.Frames.Count}"); | ||||
|             if (c.GUID == "cameraOrbit") | ||||
|             { | ||||
|                 MainCameraOrbit.DeserializeFrames(c); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 yield return Builder.SpawnSerializedCoroutine(c); | ||||
|             } | ||||
|         } | ||||
|         bc.Timeline.Deserialize(TimelineController.Instance); | ||||
|         (CurrentScene as KF3SceneContainer).Frames = (bc as KF3SceneSerializable).Frames.Select(f => new FrameContent(f)).ToList(); | ||||
|         yield return 0; | ||||
|         TimelineController.SetCurrentFrame(TimelineController.Instance.CurrentFrame); | ||||
|     } | ||||
|  | ||||
|     public static void FocusOn(Camera camera, GameObject focusedObject, float cameraDistance) | ||||
|     { | ||||
|         Bounds bounds = GetBoundsWithChildren(focusedObject); | ||||
|  | ||||
|         Vector3 objectSizes = bounds.max - bounds.min; | ||||
|         float objectSize = Mathf.Max(objectSizes.x, objectSizes.y, objectSizes.z); | ||||
|         float cameraView = 2.0f * Mathf.Tan(0.5f * Mathf.Deg2Rad * Camera.main.fieldOfView); // Visible height 1 meter in front | ||||
|         float distance = cameraDistance * objectSize / cameraView; // Combined wanted distance from the object | ||||
|         distance += 0.5f * objectSize; // Estimated offset from the center to the outside of the object | ||||
|         Camera.main.transform.position = bounds.center - distance * Camera.main.transform.forward; | ||||
|     } | ||||
|  | ||||
|     public static Bounds GetBoundsWithChildren(GameObject gameObject) | ||||
|     { | ||||
|         Renderer parentRenderer = gameObject.GetComponent<Renderer>(); | ||||
|  | ||||
|         Renderer[] childrenRenderers = gameObject.GetComponentsInChildren<Renderer>(); | ||||
|  | ||||
|         Bounds bounds = parentRenderer != null | ||||
|            ? parentRenderer.bounds | ||||
|            : childrenRenderers.FirstOrDefault(x => x.enabled).bounds; | ||||
|  | ||||
|         if (childrenRenderers.Length > 0) | ||||
|         { | ||||
|             foreach (Renderer renderer in childrenRenderers) | ||||
|             { | ||||
|                 if (renderer.enabled) | ||||
|                 { | ||||
|                     bounds.Encapsulate(renderer.bounds); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return bounds; | ||||
|     } | ||||
|  | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/KF3ModelViewerMain.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/KF3ModelViewerMain.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 2cf8b98999cdac848800dcd38e22455e | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										732
									
								
								Assets/KF3/Scripts/KF3Names.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										732
									
								
								Assets/KF3/Scripts/KF3Names.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,732 @@ | ||||
| using System; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
|  | ||||
| public static class KF3Names | ||||
| { | ||||
|     public static string GetCharaName(int id) | ||||
|     { | ||||
|         var charaData = KF3AssetLibrary.Instance.CharaData.FirstOrDefault(c => c.id == id); | ||||
|         if(charaData != null) | ||||
|         { | ||||
|             return $"{(String.IsNullOrEmpty(charaData.nameEn) ? charaData.name : charaData.nameEn)} {(String.IsNullOrEmpty(charaData.nickname) ? "" : charaData.nickname)}"; | ||||
|         } | ||||
|         switch (id) | ||||
|         { | ||||
|             case 1: | ||||
|                 return "Dhole"; | ||||
|             case 2: | ||||
|                 return "Serval"; | ||||
|             case 3: | ||||
|                 return "Fennec"; | ||||
|             case 4: | ||||
|                 return "Common Raccoon"; | ||||
|             case 5: | ||||
|                 return "Tasmanian Devil"; | ||||
|             case 6: | ||||
|                 return "Small-clawed Otter"; | ||||
|             case 7: | ||||
|                 return "Jaguar"; | ||||
|             case 8: | ||||
|                 return "Alpaca Suri"; | ||||
|             case 9: | ||||
|                 return "Lion"; | ||||
|             case 10: | ||||
|                 return "Moose"; | ||||
|             case 11: | ||||
|                 return "Northern White-faced Owl"; | ||||
|             case 12: | ||||
|                 return "Eurasian Eagle Owl"; | ||||
|             case 13: | ||||
|                 return "Ezo Red Fox"; | ||||
|             case 14: | ||||
|                 return "Silver Fox"; | ||||
|             case 15: | ||||
|                 return "Golden Snub-nosed Monkey"; | ||||
|             case 16: | ||||
|                 return "Brown Bear"; | ||||
|             case 17: | ||||
|                 return "Sheep"; | ||||
|             case 18: | ||||
|                 return "Blackbuck"; | ||||
|             case 19: | ||||
|                 return "Californian Sea Otter"; | ||||
|             case 20: | ||||
|                 return "Australian Devil"; | ||||
|             case 21: | ||||
|                 return "Peach Panther"; | ||||
|             case 22: | ||||
|                 return "Meerkat"; | ||||
|             case 23: | ||||
|                 return "Chinese Spot-Billed Duck"; | ||||
|             case 24: | ||||
|                 return "Royal Penguin"; | ||||
|             case 25: | ||||
|                 return "Emperor Penguin"; | ||||
|             case 26: | ||||
|                 return "Humboldt Penguin"; | ||||
|             case 27: | ||||
|                 return "Rockhopper Penguin"; | ||||
|             case 28: | ||||
|                 return "Gentoo Penguin"; | ||||
|             case 29: | ||||
|                 return "Plains Zebra"; | ||||
|             case 30: | ||||
|                 return "Thomson's Gazelle"; | ||||
|             case 31: | ||||
|                 return "Hippopotamus"; | ||||
|             case 33: | ||||
|                 return "Malayan Tapir"; | ||||
|             case 34: | ||||
|                 return "Fossa"; | ||||
|             case 35: | ||||
|                 return "Indian Elephant"; | ||||
|             case 37: | ||||
|                 return "King Cobra"; | ||||
|             case 38: | ||||
|                 return "Southern Tamandua"; | ||||
|             case 39: | ||||
|                 return "Peafowl"; | ||||
|             case 41: | ||||
|                 return "Okapi"; | ||||
|             case 42: | ||||
|                 return "Japanese Crested Ibis"; | ||||
|             case 43: | ||||
|                 return "Scarlet Ibis"; | ||||
|             case 44: | ||||
|                 return "Sand Cat"; | ||||
|             case 45: | ||||
|                 return "Tsuchinoko"; | ||||
|             case 46: | ||||
|                 return "American Beaver"; | ||||
|             case 47: | ||||
|                 return "Black-tailed Prairie Dog"; | ||||
|             case 48: | ||||
|                 return "Aurochs"; | ||||
|             case 49: | ||||
|                 return "Arabian oryx"; | ||||
|             case 51: | ||||
|                 return "White Rhinoceros"; | ||||
|             case 52: | ||||
|                 return "Panther Chameleon"; | ||||
|             case 53: | ||||
|                 return "Shoebill"; | ||||
|             case 54: | ||||
|                 return "Giant Armadillo"; | ||||
|             case 56: | ||||
|                 return "Margay"; | ||||
|             case 57: | ||||
|                 return "Capybara"; | ||||
|             case 58: | ||||
|                 return "Campo Flicker"; | ||||
|             case 59: | ||||
|                 return "Gray Wolf"; | ||||
|             case 60: | ||||
|                 return "Reticulated Giraffe"; | ||||
|             case 61: | ||||
|                 return "African Wild Dog"; | ||||
|             case 62: | ||||
|                 return "Common Dolphin"; | ||||
|             case 63: | ||||
|                 return "Mammoth"; | ||||
|             case 64: | ||||
|                 return "White Tiger"; | ||||
|             case 65: | ||||
|                 return "Saber-Toothed Tiger"; | ||||
|             case 66: | ||||
|                 return "Greater Flamingo"; | ||||
|             case 67: | ||||
|                 return "Raccoon Dog"; | ||||
|             case 68: | ||||
|                 return "Black Leopard"; | ||||
|             case 69: | ||||
|                 return "Cheetah"; | ||||
|             case 70: | ||||
|                 return "Blue Whale"; | ||||
|             case 71: | ||||
|                 return "Giant Penguin"; | ||||
|             case 72: | ||||
|                 return "Holstein Friesian Cattle"; | ||||
|             case 73: | ||||
|                 return "Tibetan Fox"; | ||||
|             case 74: | ||||
|                 return "Atlantic Puffin"; | ||||
|             case 75: | ||||
|                 return "Silky Anteater"; | ||||
|             case 76: | ||||
|                 return "Great Auk"; | ||||
|             case 77: | ||||
|                 return "Manul"; | ||||
|             case 78: | ||||
|                 return "Giant Anteater"; | ||||
|             case 79: | ||||
|                 return "Aye-aye"; | ||||
|             case 83: | ||||
|                 return "Dromedary"; | ||||
|             case 84: | ||||
|                 return "Bactrian Camel"; | ||||
|             case 85: | ||||
|                 return "Western Lowland Gorilla"; | ||||
|             case 87: | ||||
|                 return "Common Ostrich"; | ||||
|             case 88: | ||||
|                 return "Reindeer"; | ||||
|             case 89: | ||||
|                 return "Black rhinoceros"; | ||||
|             case 91: | ||||
|                 return "Arctic Hare"; | ||||
|             case 92: | ||||
|                 return "Alpine Marmot"; | ||||
|             case 93: | ||||
|                 return "Chinese White Dolphin"; | ||||
|             case 94: | ||||
|                 return "Californian Sea Lion"; | ||||
|             case 95: | ||||
|                 return "Komodo Dragon"; | ||||
|             case 97: | ||||
|                 return "Common Slider"; | ||||
|             case 98: | ||||
|                 return "Genbu"; | ||||
|             case 99: | ||||
|                 return "Seiryu"; | ||||
|             case 100: | ||||
|                 return "Byakko"; | ||||
|             case 101: | ||||
|                 return "Suzaku"; | ||||
|             case 102: | ||||
|                 return "Shisa Lefty"; | ||||
|             case 103: | ||||
|                 return "Shisa Right"; | ||||
|             case 104: | ||||
|                 return "Oinarisama"; | ||||
|             case 105: | ||||
|                 return "Kyubikitsune"; | ||||
|             case 106: | ||||
|                 return "Bearded Seal"; | ||||
|             case 108: | ||||
|                 return "African Elephant"; | ||||
|             case 109: | ||||
|                 return "African Rock Python"; | ||||
|             case 110: | ||||
|                 return "Greater Rhea"; | ||||
|             case 112: | ||||
|                 return "Cat"; | ||||
|             case 113: | ||||
|                 return "Unicorn Whale"; | ||||
|             case 114: | ||||
|                 return "Inugamigyoubu"; | ||||
|             case 118: | ||||
|                 return "Giant Pangolin"; | ||||
|             case 119: | ||||
|                 return "Northern Goshawk"; | ||||
|             case 120: | ||||
|                 return "Greater Roadrunner"; | ||||
|             case 125: | ||||
|                 return "Bergman's Bear"; | ||||
|             case 127: | ||||
|                 return "Caracal"; | ||||
|             case 133: | ||||
|                 return "Golden Tabby Tiger"; | ||||
|             case 134: | ||||
|                 return "Kodiak Bear"; | ||||
|             case 136: | ||||
|                 return "Sivatherium"; | ||||
|             case 138: | ||||
|                 return "Giant Panda"; | ||||
|             case 140: | ||||
|                 return "Jinmengyo"; | ||||
|             case 141: | ||||
|                 return "Sky Fish"; | ||||
|             case 148: | ||||
|                 return "Japanese Wolf"; | ||||
|             case 149: | ||||
|                 return "Japanese Otter"; | ||||
|             case 151: | ||||
|                 return "Barbary Lion"; | ||||
|             case 153: | ||||
|                 return "Bald Eagle"; | ||||
|             case 154: | ||||
|                 return "Jungle Crow"; | ||||
|             case 155: | ||||
|                 return "Okinawa Habu"; | ||||
|             case 156: | ||||
|                 return "Bottlenose Dolphin"; | ||||
|             case 158: | ||||
|                 return "Leopard"; | ||||
|             case 161: | ||||
|                 return "Black Jaguar"; | ||||
|             case 165: | ||||
|                 return "Maltese Tiger"; | ||||
|             case 166: | ||||
|                 return "Mexico Salamander"; | ||||
|             case 168: | ||||
|                 return "Yatagarasu"; | ||||
|             case 170: | ||||
|                 return "Okinawa Rail"; | ||||
|             case 174: | ||||
|                 return "Lesser Panda"; | ||||
|             case 176: | ||||
|                 return "Chapman's Zebra"; | ||||
|             case 178: | ||||
|                 return "Chicken"; | ||||
|             case 179: | ||||
|                 return "Alpaca Huacaya"; | ||||
|             case 180: | ||||
|                 return "White Lion"; | ||||
|             case 182: | ||||
|                 return "Geoffroy's Cat"; | ||||
|             case 188: | ||||
|                 return "Red Fox"; | ||||
|             case 191: | ||||
|                 return "Bat-Eared Fox"; | ||||
|             case 193: | ||||
|                 return "Aardwolf"; | ||||
|             case 195: | ||||
|                 return "Dog"; | ||||
|             case 196: | ||||
|                 return "Ezo Brown Bear"; | ||||
|             case 197: | ||||
|                 return "Gambian Rat"; | ||||
|             case 199: | ||||
|                 return "King Penguin"; | ||||
|             case 200: | ||||
|                 return "Adélie Penguin"; | ||||
|             case 203: | ||||
|                 return "Blue Wildebeest"; | ||||
|             case 204: | ||||
|                 return "Black Wildebeest"; | ||||
|             case 207: | ||||
|                 return "Mountain Tapir"; | ||||
|             case 217: | ||||
|                 return "African Penguin"; | ||||
|             case 221: | ||||
|                 return "Salt-water Crocodile"; | ||||
|             case 222: | ||||
|                 return "Shiserval Right"; | ||||
|             case 223: | ||||
|                 return "Shiserval Lefty"; | ||||
|             case 233: | ||||
|                 return "Chestnut Thoroughbred Horse"; | ||||
|             case 234: | ||||
|                 return "Brown Thoroughbred Horse"; | ||||
|             case 235: | ||||
|                 return "White Thoroughbred Horse"; | ||||
|             case 236: | ||||
|                 return "Vampire Bat"; | ||||
|             case 237: | ||||
|                 return "Long-tailed Whiskered Bat"; | ||||
|             case 239: | ||||
|                 return "Black-Headed Ibis"; | ||||
|             case 241: | ||||
|                 return "Serval"; | ||||
|             case 242: | ||||
|                 return "Superb Bird-of-Paradise"; | ||||
|             case 243: | ||||
|                 return "Western Parotia"; | ||||
|             case 244: | ||||
|                 return "Degu"; | ||||
|             case 245: | ||||
|                 return "Long-tailed Chinchilla"; | ||||
|             case 253: | ||||
|                 return "Harp Seal"; | ||||
|             case 258: | ||||
|                 return "Striated Caracara"; | ||||
|             case 263: | ||||
|                 return "Greater Honeyguide"; | ||||
|             case 264: | ||||
|                 return "Scarlet Macaw"; | ||||
|             case 265: | ||||
|                 return "Resplendent Quetzal"; | ||||
|             case 267: | ||||
|                 return "Siberian Husky"; | ||||
|             case 273: | ||||
|                 return "Passenger Pigeon"; | ||||
|             case 276: | ||||
|                 return "Secretarybird"; | ||||
|             case 282: | ||||
|                 return "Greater Bird-of-Paradise"; | ||||
|             case 284: | ||||
|                 return "Indian Wolf"; | ||||
|             case 290: | ||||
|                 return "Emerald Tree Boa"; | ||||
|             case 291: | ||||
|                 return "Garden Tree Boa"; | ||||
|             case 301: | ||||
|                 return "Orca"; | ||||
|             case 302: | ||||
|                 return "Dog"; | ||||
|             case 307: | ||||
|                 return "Amur Tiger"; | ||||
|             case 314: | ||||
|                 return "Pronghorn"; | ||||
|             case 316: | ||||
|                 return "Jack-o'-Lantern"; | ||||
|             case 318: | ||||
|                 return "Cerberus"; | ||||
|             case 321: | ||||
|                 return "Cellval"; | ||||
|             case 322: | ||||
|                 return "Serval"; | ||||
|             case 323: | ||||
|                 return "Pig"; | ||||
|             case 327: | ||||
|                 return "White Serval"; | ||||
|             case 333: | ||||
|                 return "Tasmanian Devil"; | ||||
|             case 334: | ||||
|                 return "Blackbuck"; | ||||
|             case 335: | ||||
|                 return "Californian Sea Otter"; | ||||
|             case 336: | ||||
|                 return "Australian Devil"; | ||||
|             case 337: | ||||
|                 return "Common Dolphin"; | ||||
|             case 338: | ||||
|                 return "Blue Whale"; | ||||
|             case 339: | ||||
|                 return "Californian Sea Lion"; | ||||
|             case 340: | ||||
|                 return "Common Raccoon"; | ||||
|             case 341: | ||||
|                 return "Fennec"; | ||||
|             case 342: | ||||
|                 return "Fennec"; | ||||
|             case 343: | ||||
|                 return "キンシコウ"; | ||||
|             case 344: | ||||
|                 return "アイアイ"; | ||||
|             case 345: | ||||
|                 return "オオセンザンコウ"; | ||||
|             case 346: | ||||
|                 return "オオタカ"; | ||||
|             case 347: | ||||
|                 return "ホワイトライオン"; | ||||
|             case 349: | ||||
|                 return "Royal Penguin【PPPのプリンセス】"; | ||||
|             case 350: | ||||
|                 return "Southern Tamandua【一撃のポーズぅ!】"; | ||||
|             case 351: | ||||
|                 return "Tasmanian Devil"; | ||||
|             case 352: | ||||
|                 return "Lion"; | ||||
|             case 353: | ||||
|                 return "Blackbuck"; | ||||
|             case 354: | ||||
|                 return "Australian Devil"; | ||||
|             case 355: | ||||
|                 return "Malayan Tapir【やってみる…!】"; | ||||
|             case 356: | ||||
|                 return "Common Ostrich【占いのその先へ】"; | ||||
|             case 357: | ||||
|                 return "Chapman's Zebra【オシャレリーダー】"; | ||||
|             case 358: | ||||
|                 return "Common Raccoon【時代が来たのだ!】"; | ||||
|             case 359: | ||||
|                 return "Japanese Crested Ibis【疑惑の美声?】"; | ||||
|             case 360: | ||||
|                 return "Fennec【私の時代も来たかなー】"; | ||||
|             case 363: | ||||
|                 return "Sand Cat【いいこと思いつきました】"; | ||||
|             case 364: | ||||
|                 return "Dhole【頼れる副隊長】"; | ||||
|             case 365: | ||||
|                 return "Small-clawed Otter【笑顔をお届け!】"; | ||||
|             case 366: | ||||
|                 return "Tsuchinoko【頼られちゃ仕方ない】"; | ||||
|             case 367: | ||||
|                 return "Ezo Red Fox【ぷろげーまー】"; | ||||
|             case 368: | ||||
|                 return "Silver Fox【天才発明家・G】"; | ||||
|             case 369: | ||||
|                 return "Yak"; | ||||
|             case 380: | ||||
|                 return "Hello Kitty♥serval"; | ||||
|             case 381: | ||||
|                 return "Hello Mimmy♥serval"; | ||||
|             case 382: | ||||
|                 return "Jaguar【連撃の極意】"; | ||||
|             case 383: | ||||
|                 return "Black Jaguar【一撃の極意】"; | ||||
|             case 384: | ||||
|                 return "Common Dolphin【わっふいわっふーい!】"; | ||||
|             case 385: | ||||
|                 return "Meerkat【正義の家庭教師】"; | ||||
|             case 386: | ||||
|                 return "Caracal"; | ||||
|             case 387: | ||||
|                 return "Cellval"; | ||||
|             case 388: | ||||
|                 return "Phoenix"; | ||||
|             case 389: | ||||
|                 return "Unico"; | ||||
|             case 390: | ||||
|                 return "Bald Eagle【みんなでジャスティス】"; | ||||
|             case 391: | ||||
|                 return "Northern Goshawk【みんなでクールに】"; | ||||
|             case 396: | ||||
|                 return "Witch"; | ||||
|             case 397: | ||||
|                 return "Draco Centaur"; | ||||
|             case 399: | ||||
|                 return "Tachikoma Standard"; | ||||
|             case 400: | ||||
|                 return "Tachikoma Heavy-armed"; | ||||
|             case 401: | ||||
|                 return "Paraceratherium"; | ||||
|             case 901: | ||||
|                 return ""; | ||||
|             case 902: | ||||
|                 return ""; | ||||
|             case 995: | ||||
|                 return "Tachikoma Standard"; | ||||
|             case 996: | ||||
|                 return "Tachikoma Heavy-armed"; | ||||
|             case 997: | ||||
|                 return "White Serval"; | ||||
|             case 998: | ||||
|                 return "Dhole (Cutscene)"; | ||||
|             case 1001: | ||||
|                 return "Mirai"; | ||||
|             case 1002: | ||||
|                 return "Calenda"; | ||||
|             case 1003: | ||||
|                 return "Flicky"; | ||||
|             case 1004: | ||||
|                 return "Boss"; | ||||
|             case 1005: | ||||
|                 return "Boss (Radio)"; | ||||
|             case 1006: | ||||
|                 return "Kako"; | ||||
|             case 1007: | ||||
|                 return "Nana"; | ||||
|             case 1008: | ||||
|                 return "Calenda (Cutscene)"; | ||||
|             case 1009: | ||||
|                 return "Flicky (Damaged)"; | ||||
|             case 1010: | ||||
|                 return "Eyes"; | ||||
|             case 1011: | ||||
|                 return "RulerCell Chrysalis"; | ||||
|             case 1012: | ||||
|                 return "RulerCell"; | ||||
|             case 1013: | ||||
|                 return "Hello Kitty"; | ||||
|         } | ||||
|         return id.ToString(); | ||||
|     } | ||||
|  | ||||
|     public static Dictionary<Func<int, bool>, string> CeruleanNames = new Dictionary<Func<int, bool>, string>(); | ||||
|  | ||||
|     public static void LoadCeruleanNames() | ||||
|     { | ||||
|         string filePath = Path.Combine(Application.dataPath + "/../", "Celliens.txt"); | ||||
|         if (File.Exists(filePath)) | ||||
|         { | ||||
|             var lines = File.ReadAllLines(filePath); | ||||
|             foreach(var line in lines) | ||||
|             { | ||||
|                 var split = line.Split(';'); | ||||
|                 if (split.Length != 2) continue; | ||||
|                 int id = -1; | ||||
|                 if (!int.TryParse(split[0], out id)) continue; | ||||
|                 CeruleanNames.Add(x => x < id, split[1].Trim()); | ||||
|             } | ||||
|             Error.Log(Color.green, $"Loaded {CeruleanNames.Count} Cellien Names"); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Error.Log(Color.yellow, $"Celliens.txt not found, loading default list"); | ||||
|             CeruleanNames = new Dictionary<Func<int, bool>, string> | ||||
|             { | ||||
|                 { x => x < 20010, "civile" }, | ||||
|                 { x => x < 20020, "fangcell" }, | ||||
|                 { x => x < 20030, "Zoospores" }, | ||||
|                 { x => x < 20040, "Mikazuki" }, | ||||
|                 { x => x < 20050, "volvox" }, | ||||
|                 { x => x < 20056, "Tirucel" }, | ||||
|                 { x => x < 20057, "Tiruchel (Majimun)" }, | ||||
|                 { x => x < 20060, "Tiruchel" }, | ||||
|                 { x => x < 20070, "Hunter Cell" }, | ||||
|                 { x => x < 20080, "denwa" }, | ||||
|                 { x => x < 20090, "bolt" }, | ||||
|                 { x => x < 20100, "met" }, | ||||
|                 { x => x < 20110, "Hwarin" }, | ||||
|                 { x => x < 20120, "Koonin" }, | ||||
|                 { x => x < 20130, "Octopus" }, | ||||
|                 { x => x < 20140, "loco loco" }, | ||||
|                 { x => x < 20150, "Horus Cell" }, | ||||
|                 { x => x < 20162, "boat" }, | ||||
|                 { x => x < 20171, "Santamet" }, | ||||
|                 { x => x < 20180, "New Year's bolt" }, | ||||
|                 { x => x < 20192, "kepeshsel" }, | ||||
|                 { x => x < 20202, "Fang Cell (Christmas)" }, | ||||
|                 { x => x < 20210, "Mikazuki (Christmas)" }, | ||||
|                 { x => x < 20220, "Yavacell" }, | ||||
|                 { x => x < 20230, "phage cell" }, | ||||
|                 { x => x < 20240, "white fangcell" }, | ||||
|                 { x => x < 20250, "White Mikazuki" }, | ||||
|                 { x => x < 20260, "White Volvox" }, | ||||
|                 { x => x < 20263, "Octopus (Majimun)" }, | ||||
|                 { x => x < 20265, "Octopus (Mazimun)" }, | ||||
|                 { x => x < 20270, "Octopus (Octopus)" }, | ||||
|                 { x => x < 20310, "Tiruchel (Mazimun)" }, | ||||
|                 { x => x < 20330, "Santamet" }, | ||||
|                 { x => x < 20340, "Boombox" }, | ||||
|                 { x => x < 20350, "loco loco (magimun)" }, | ||||
|                 { x => x < 20360, "video camera" }, | ||||
|                 { x => x < 20380, "door" }, | ||||
|                 { x => x < 20420, "hosiery" }, | ||||
|                 { x => x < 20430, "paramecium" }, | ||||
|                 { x => x < 20441, "dioid fang cell" }, | ||||
|                 { x => x < 20450, "Tachyrians" }, | ||||
|                 { x => x < 20460, "Bolt" }, | ||||
|                 { x => x < 20470, "Met" }, | ||||
|                 { x => x < 20480, "Koonin" }, | ||||
|                 { x => x < 20490, "mimicel" }, | ||||
|                 { x => x < 20510, "horn cell" }, | ||||
|                 { x => x < 21001, "sma" }, | ||||
|                 { x => x < 21002, "akagau" }, | ||||
|                 { x => x < 21003, "greengau" }, | ||||
|                 { x => x < 21004, "bluegau" }, | ||||
|                 { x => x < 21005, "akagau" }, | ||||
|                 { x => x < 21006, "greengau" }, | ||||
|                 { x => x < 21007, "blue-gau" }, | ||||
|                 { x => x < 21008, "akagau" }, | ||||
|                 { x => x < 21010, "aogau" }, | ||||
|                 { x => x < 21030, "gotsun" }, | ||||
|                 { x => x < 21036, "eyeball outlet (temporary)" }, | ||||
|                 { x => x < 21040, "eyeball outlet" }, | ||||
|                 { x => x < 21050, "Ikarin" }, | ||||
|                 { x => x < 21059, "raincoat" }, | ||||
|                 { x => x < 21060, "raincoat (majimun)" }, | ||||
|                 { x => x < 21065, "builder shovel" }, | ||||
|                 { x => x < 21067, "Builder's shovel (for checking site destruction)" }, | ||||
|                 { x => x < 21068, "Builder Shovel (Mazimun)" }, | ||||
|                 { x => x < 21080, "builder's shovel" }, | ||||
|                 { x => x < 21090, "Senetocell" }, | ||||
|                 { x => x < 21100, "black gau" }, | ||||
|                 { x => x < 21112, "Black Gotsun" }, | ||||
|                 { x => x < 21121, "Christmas Karin" }, | ||||
|                 { x => x < 21130, "Kagamimochi gotsun" }, | ||||
|                 { x => x < 21153, "Aogau (Majimun)" }, | ||||
|                 { x => x < 21154, "akagau (majimun)" }, | ||||
|                 { x => x < 21155, "green gau" }, | ||||
|                 { x => x < 21160, "aogau (majimun)" }, | ||||
|                 { x => x < 21170, "Gottsun (Mazimun)" }, | ||||
|                 { x => x < 21180, "Raincoat (Mazimun)" }, | ||||
|                 { x => x < 21190, "Eyeball outlet (Mazimun)" }, | ||||
|                 { x => x < 21201, "Builder shovel (Mazimun)" }, | ||||
|                 { x => x < 21210, "Ikarin (Mazimun)" }, | ||||
|                 { x => x < 21220, "Sachiko (Mazimun)" }, | ||||
|                 { x => x < 21224, "Sachiko" }, | ||||
|                 { x => x < 21232, "Black Sachiko" }, | ||||
|                 { x => x < 21240, "Sachiko" }, | ||||
|                 { x => x < 21270, "Alex" }, | ||||
|                 { x => x < 21273, "black senet cell" }, | ||||
|                 { x => x < 21280, "black builder shovel" }, | ||||
|                 { x => x < 21281, "Flicky" }, | ||||
|                 { x => x < 21282, "Flicky right foot" }, | ||||
|                 { x => x < 21290, "Flicky left foot" }, | ||||
|                 { x => x < 21291, "Akagau first generation" }, | ||||
|                 { x => x < 21293, "Aogau first generation" }, | ||||
|                 { x => x < 21295, "Akagau 1st generation" }, | ||||
|                 { x => x < 21310, "Aogau 1st generation" }, | ||||
|                 { x => x < 21330, "Akagau 4th generation" }, | ||||
|                 { x => x < 21340, "Seiryu the Holy Beast" }, | ||||
|                 { x => x < 21350, "Holy Beast Byakko" }, | ||||
|                 { x => x < 21360, "Holy Beast Suzaku" }, | ||||
|                 { x => x < 21380, "holy beast gembu" }, | ||||
|                 { x => x < 21390, "Akagau second generation" }, | ||||
|                 { x => x < 21400, "Senetocer" }, | ||||
|                 { x => x < 21410, "eyeball outlet (temporary)" }, | ||||
|                 { x => x < 21420, "birdcell" }, | ||||
|                 { x => x < 21430, "Test boss" }, | ||||
|                 { x => x < 21470, "bird cell" }, | ||||
|                 { x => x < 21480, "Triceragaon" }, | ||||
|                 { x => x < 21486, "Midorigau (Majimun)" }, | ||||
|                 { x => x < 21493, "Gotsun (Mazimun)" }, | ||||
|                 { x => x < 21501, "Raincoat (Mazimun)" }, | ||||
|                 { x => x < 21509, "Eyeball outlet (Mazimun)" }, | ||||
|                 { x => x < 21523, "Builder shovel (Mazimun)" }, | ||||
|                 { x => x < 21530, "Senet cell" }, | ||||
|                 { x => x < 21550, "Sachiko (Mazimun)" }, | ||||
|                 { x => x < 21560, "Dio cerulean terminus" }, | ||||
|                 { x => x < 21570, "Chibi Dio Cerulean" }, | ||||
|                 { x => x < 21610, "Midori gau (magimun)" }, | ||||
|                 { x => x < 21620, "Black Senetocer" }, | ||||
|                 { x => x < 40000, "Unknown" }, | ||||
|                 {x => x <40010, "Gacha Capsule/Card"}, | ||||
|                 {x => x <40200, "Gacha Box"}, | ||||
|                 {x => x <40300, "Blue Gacha Capsule"}, | ||||
|                 {x => x <40400, "Furniture Gacha"}, | ||||
|                 { x => x != -1 , "Unknown" } | ||||
|             }; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public static string GetEnemyName(int id) | ||||
|     { | ||||
|         var cases = CeruleanNames; | ||||
|         return cases.First(kvp => kvp.Key(id)).Value; | ||||
|     } | ||||
|  | ||||
|     public static string GetDressName(string id) | ||||
|     { | ||||
|         switch (id) | ||||
|         { | ||||
|             case "a": return "Default"; | ||||
|             case "aa": return "Default (V2)"; | ||||
|             case "b": return "Special"; | ||||
|             case "c": return "Tracksuit"; | ||||
|             case "d": return "Park Ranger"; | ||||
|             case "e": return "Maid"; | ||||
|             case "f": return "Event Costume 1"; | ||||
|             case "g": return "Various"; | ||||
|             case "h": return "Party Dress"; | ||||
|             case "i": return "School Uniform"; | ||||
|             case "j": return "Sports Outfit"; | ||||
|             case "k": return "Raincoat"; | ||||
|             case "l": return "Dojo (Y)"; | ||||
|             case "m": return "Dojo (G)"; | ||||
|             case "n": return "Dojo (B)"; | ||||
|             case "o": return "Dojo (R)"; | ||||
|             case "p": return "Orihime"; | ||||
|             case "q": return "Swimsuit 1"; | ||||
|             case "r": return "Swimsuit 2"; | ||||
|             case "s": return "XXX Swimsuit"; | ||||
|             case "t": return "Lifeguard"; | ||||
|             case "u": return "Harvest"; | ||||
|             case "v": return "Halloween"; | ||||
|             case "w": return "Maid 2"; | ||||
|         } | ||||
|         return id; | ||||
|     } | ||||
| } | ||||
|  | ||||
| public class JsonHelper | ||||
| { | ||||
|     public static T[] getJsonArray<T>(string json) | ||||
|     { | ||||
|         string newJson = "{ \"array\": " + json + "}"; | ||||
|         Wrapper<T> wrapper = JsonUtility.FromJson<Wrapper<T>>(newJson); | ||||
|         return wrapper.array; | ||||
|     } | ||||
|  | ||||
|     [Serializable] | ||||
|     private class Wrapper<T> | ||||
|     { | ||||
|         public T[] array; | ||||
|     } | ||||
| } | ||||
|  | ||||
| [System.Serializable] | ||||
| public class CharaData | ||||
| { | ||||
|     public int id; | ||||
|     public string name; | ||||
|     public string nameEn; | ||||
|     public string nickname; | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/KF3Names.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/KF3Names.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: e76810d5ce882584f9f8bcd8180e8e77 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										272
									
								
								Assets/KF3/Scripts/Osage.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										272
									
								
								Assets/KF3/Scripts/Osage.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,272 @@ | ||||
| using System; | ||||
| using UnityEngine; | ||||
|  | ||||
| // Token: 0x0200006D RID: 109 | ||||
| public class Osage : MonoBehaviour | ||||
| { | ||||
|     // Token: 0x06000295 RID: 661 RVA: 0x00014858 File Offset: 0x00012A58 | ||||
|     private void Initialize() | ||||
|     { | ||||
|         if (this.trs != null) | ||||
|         { | ||||
|             return; | ||||
|         } | ||||
|         this.trs = base.transform; | ||||
|         this.localRotation = this.trs.localRotation; | ||||
|         this.initialLocalPos = this.trs.localPosition; | ||||
|         this.scale = this.trs.localScale.x; | ||||
|         Transform parent = this.trs.parent; | ||||
|         while (parent != null) | ||||
|         { | ||||
|             this.scale *= parent.localScale.x; | ||||
|             parent = parent.parent; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // Token: 0x06000296 RID: 662 RVA: 0x000148F0 File Offset: 0x00012AF0 | ||||
|     private void Awake() | ||||
|     { | ||||
|         this.Initialize(); | ||||
|         this.childBone = null; | ||||
|         foreach (object obj in base.transform) | ||||
|         { | ||||
|             Transform transform = (Transform)obj; | ||||
|             if (transform.name.IndexOf("j_osg") == 0) | ||||
|             { | ||||
|                 this.childBone = transform; | ||||
|                 break; | ||||
|             } | ||||
|         } | ||||
|         this.parentBone = ((base.transform.parent == null || base.transform.parent.GetComponent<Osage>() == null) ? null : base.transform.parent); | ||||
|         this.reset = 0; | ||||
|     } | ||||
|  | ||||
|     // Token: 0x06000297 RID: 663 RVA: 0x000149B0 File Offset: 0x00012BB0 | ||||
|     private void Start() | ||||
|     { | ||||
|         if (this.trs == null) | ||||
|         { | ||||
|             return; | ||||
|         } | ||||
|         if (this.childBone == null) | ||||
|         { | ||||
|             this.springLength = this.boneAxis.magnitude * this.scale; | ||||
|             this.crntPos = this.trs.TransformPoint(this.boneAxis); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             this.springLength = Vector3.Distance(this.trs.position, this.childBone.position); | ||||
|             this.crntPos = this.childBone.position; | ||||
|         } | ||||
|         this.prevPos = this.crntPos; | ||||
|         this.oldPos = new Vector3(0f, -9999f, 0f); | ||||
|     } | ||||
|  | ||||
|     // Token: 0x06000298 RID: 664 RVA: 0x00014A64 File Offset: 0x00012C64 | ||||
|     private void UpdateSpring(bool rst, Transform thighL, Transform thighR, bool mov) | ||||
|     { | ||||
|         if (!enabled) return; | ||||
|         if (mov) | ||||
|         { | ||||
|             this.trs.localRotation = Quaternion.identity * this.localRotation; | ||||
|             Vector3 fromDirection = this.trs.TransformDirection(this.boneAxis); | ||||
|             if (rst) | ||||
|             { | ||||
|                 this.crntPos = fromDirection.normalized * this.springLength + this.trs.position; | ||||
|                 this.prevPos = this.crntPos; | ||||
|             } | ||||
|             this.oldPos = this.trs.position; | ||||
|             Vector3 a = this.trs.rotation * (this.boneAxis * this.stiffnessForce); | ||||
|             a += (this.prevPos - this.crntPos) / this.scale * this.dragForce; | ||||
|             a += this.springForce; | ||||
|             Vector3 vector = this.crntPos; | ||||
|             this.crntPos = this.crntPos - this.prevPos + this.crntPos + a * this.scale; | ||||
|             this.crntPos = (this.crntPos - this.trs.position).normalized * this.springLength + this.trs.position; | ||||
|             this.prevPos = vector; | ||||
|             Quaternion lhs = Quaternion.FromToRotation(fromDirection, this.crntPos - this.trs.position); | ||||
|             this.trs.rotation = lhs * this.trs.rotation; | ||||
|             if (thighL != null && thighR != null && base.name == "j_osg_apron_a") | ||||
|             { | ||||
|                 float num = 90f - thighL.eulerAngles.z; | ||||
|                 if (num < 0f) | ||||
|                 { | ||||
|                     num = 0f; | ||||
|                 } | ||||
|                 float num2 = 90f - thighR.eulerAngles.z; | ||||
|                 if (num2 < 0f) | ||||
|                 { | ||||
|                     num2 = 0f; | ||||
|                 } | ||||
|                 float num3 = this.localRotation.eulerAngles.x - (num + num2) * 0.5f; | ||||
|                 Vector3 eulerAngles = this.trs.eulerAngles; | ||||
|                 if (eulerAngles.x > num3) | ||||
|                 { | ||||
|                     eulerAngles.x = num3; | ||||
|                 } | ||||
|                 if ((num3 -= eulerAngles.x) < 0f) | ||||
|                 { | ||||
|                     num3 = 0f; | ||||
|                 } | ||||
|                 eulerAngles.y -= eulerAngles.z; | ||||
|                 eulerAngles.z = (num2 - num) * 0.5f; | ||||
|                 if (eulerAngles.z < 0f) | ||||
|                 { | ||||
|                     eulerAngles.z += num3; | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     eulerAngles.z -= num3; | ||||
|                 } | ||||
|                 this.trs.eulerAngles = eulerAngles; | ||||
|             } | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             this.prevPos = this.crntPos; | ||||
|             this.crntPos = this.trs.TransformDirection(this.boneAxis).normalized * this.springLength + this.trs.position; | ||||
|             this.oldPos = this.trs.position; | ||||
|         } | ||||
|         Osage osage = (this.childBone == null) ? null : this.childBone.GetComponent<Osage>(); | ||||
|         if (osage != null) | ||||
|         { | ||||
|             osage.UpdateSpring(rst, null, null, mov); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // Token: 0x06000299 RID: 665 RVA: 0x00014DBC File Offset: 0x00012FBC | ||||
|     public void UpdateOsage() | ||||
|     { | ||||
|         if (!enabled) return; | ||||
|         if (this.trs == null) return; | ||||
|         if (this.parentBone != null) return; | ||||
|         /* | ||||
| 		if (TimeManager.Pause) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| 		*/ | ||||
|         this.trs.localRotation = Quaternion.identity * this.localRotation; | ||||
|     } | ||||
|  | ||||
|     // Token: 0x0600029A RID: 666 RVA: 0x00014E0C File Offset: 0x0001300C | ||||
|     public void LateUpdateOsage(Transform thighL, Transform thighR) | ||||
|     { | ||||
|         if (!enabled) return; | ||||
|         if (this.trs == null) return; | ||||
|         if (this.parentBone != null) return; | ||||
|         /* | ||||
| 		if (TimeManager.Pause) | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| 		*/ | ||||
|         if (Vector3.Distance(this.oldPos, this.trs.position) / this.scale > 0.1f && this.reset < 2) | ||||
|         { | ||||
|             this.reset = 2; | ||||
|         } | ||||
|         bool mov = false; | ||||
|         Quaternion lhs = this.trs.localRotation; | ||||
|         this.trs.localRotation = Quaternion.identity * this.localRotation; | ||||
|         if (lhs == this.trs.localRotation) | ||||
|         { | ||||
|             mov = true; | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             this.trs.localRotation = lhs; | ||||
|         } | ||||
|         this.UpdateSpring(this.reset > 0, thighL, thighR, mov); | ||||
|         if (this.reset > 0) | ||||
|         { | ||||
|             this.reset--; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // Token: 0x0600029B RID: 667 RVA: 0x00014EE8 File Offset: 0x000130E8 | ||||
|     public void Reset() | ||||
|     { | ||||
|         if (this.reset < 3) | ||||
|         { | ||||
|             this.reset = 3; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // Token: 0x17000073 RID: 115 | ||||
|     // (get) Token: 0x0600029C RID: 668 RVA: 0x00014EFA File Offset: 0x000130FA | ||||
|     public Vector3 InitialLocalPos | ||||
|     { | ||||
|         get | ||||
|         { | ||||
|             return this.initialLocalPos; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // Token: 0x17000074 RID: 116 | ||||
|     // (get) Token: 0x0600029D RID: 669 RVA: 0x00014F02 File Offset: 0x00013102 | ||||
|     public Quaternion LocalRotation | ||||
|     { | ||||
|         get | ||||
|         { | ||||
|             return this.localRotation; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // Token: 0x0600029E RID: 670 RVA: 0x00014F0C File Offset: 0x0001310C | ||||
|     public void ResetForce(Osage inSrc = null) | ||||
|     { | ||||
|         this.Initialize(); | ||||
|         if (inSrc != null) | ||||
|         { | ||||
|             inSrc.Initialize(); | ||||
|             this.initialLocalPos = inSrc.InitialLocalPos; | ||||
|             this.localRotation = inSrc.LocalRotation; | ||||
|         } | ||||
|         this.trs.localPosition = this.initialLocalPos; | ||||
|         this.trs.localRotation = this.localRotation; | ||||
|     } | ||||
|  | ||||
|     // Token: 0x0400040D RID: 1037 | ||||
|     public Vector3 boneAxis = new Vector3(0f, 0f, -1f); | ||||
|  | ||||
|     // Token: 0x0400040E RID: 1038 | ||||
|     public float stiffnessForce = 0.1f; | ||||
|  | ||||
|     // Token: 0x0400040F RID: 1039 | ||||
|     public float dragForce = 0.01f; | ||||
|  | ||||
|     // Token: 0x04000410 RID: 1040 | ||||
|     public Vector3 springForce = new Vector3(0f, -0.001f, 0f); | ||||
|  | ||||
|     // Token: 0x04000411 RID: 1041 | ||||
|     private Transform childBone; | ||||
|  | ||||
|     // Token: 0x04000412 RID: 1042 | ||||
|     private Transform parentBone; | ||||
|  | ||||
|     // Token: 0x04000413 RID: 1043 | ||||
|     private float springLength; | ||||
|  | ||||
|     // Token: 0x04000414 RID: 1044 | ||||
|     private Quaternion localRotation; | ||||
|  | ||||
|     // Token: 0x04000415 RID: 1045 | ||||
|     private Transform trs; | ||||
|  | ||||
|     // Token: 0x04000416 RID: 1046 | ||||
|     private Vector3 crntPos; | ||||
|  | ||||
|     // Token: 0x04000417 RID: 1047 | ||||
|     private Vector3 prevPos; | ||||
|  | ||||
|     // Token: 0x04000418 RID: 1048 | ||||
|     private Vector3 oldPos; | ||||
|  | ||||
|     // Token: 0x04000419 RID: 1049 | ||||
|     private int reset; | ||||
|  | ||||
|     // Token: 0x0400041A RID: 1050 | ||||
|     private Vector3 initialLocalPos; | ||||
|  | ||||
|     // Token: 0x0400041B RID: 1051 | ||||
|     private float scale; | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/Osage.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/Osage.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 005df55d74d17d343a3f72b2cdfabf92 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										510
									
								
								Assets/KF3/Scripts/SimpleAnimation.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										510
									
								
								Assets/KF3/Scripts/SimpleAnimation.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,510 @@ | ||||
| using System; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.ComponentModel; | ||||
| using UnityEngine; | ||||
| using UnityEngine.Playables; | ||||
|  | ||||
| [RequireComponent(typeof(Animator))] | ||||
| public class SimpleAnimation: MonoBehaviour | ||||
| { | ||||
|     public interface State | ||||
|     { | ||||
|         bool enabled { get; set; } | ||||
|         bool isValid { get; } | ||||
|         float time { get; set; } | ||||
|         float normalizedTime { get; set; } | ||||
|         float speed { get; set; } | ||||
|         string name { get; set; } | ||||
|         float weight { get; set; } | ||||
|         float length { get; } | ||||
|         AnimationClip clip { get; } | ||||
|         WrapMode wrapMode { get; set; } | ||||
|     } | ||||
|     public Animator animator | ||||
|     { | ||||
|         get | ||||
|         { | ||||
|             if (m_Animator == null) | ||||
|             { | ||||
|                 m_Animator = GetComponent<Animator>(); | ||||
|             } | ||||
|             return m_Animator; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public bool animatePhysics | ||||
|     { | ||||
|         get { return m_AnimatePhysics; } | ||||
|         set { m_AnimatePhysics = value; animator.updateMode = m_AnimatePhysics ? AnimatorUpdateMode.AnimatePhysics : AnimatorUpdateMode.Normal; } | ||||
|     } | ||||
|  | ||||
|     public AnimatorCullingMode cullingMode | ||||
|     { | ||||
|         get { return animator.cullingMode; } | ||||
|         set { m_CullingMode = value;  animator.cullingMode = m_CullingMode; } | ||||
|     } | ||||
|  | ||||
|     public bool isPlaying { get { return m_Playable.IsPlaying(); } } | ||||
|  | ||||
|     public bool playAutomatically | ||||
|     { | ||||
|         get { return m_PlayAutomatically; } | ||||
|         set { m_PlayAutomatically = value; } | ||||
|     } | ||||
|  | ||||
|     public AnimationClip clip | ||||
|     { | ||||
|         get { return m_Clip; } | ||||
|         set | ||||
|         { | ||||
|             m_Clip = value; | ||||
|         }   | ||||
|     } | ||||
|  | ||||
|     public WrapMode wrapMode | ||||
|     { | ||||
|         get { return m_WrapMode; } | ||||
|         set { m_WrapMode = value; } | ||||
|     } | ||||
|  | ||||
|     public void AddClip(AnimationClip clip, string newName) | ||||
|     { | ||||
|         AddState(clip, newName); | ||||
|     } | ||||
|  | ||||
|     public void Blend(string stateName, float targetWeight, float fadeLength) | ||||
|     { | ||||
|         m_Animator.enabled = true; | ||||
|         Kick(); | ||||
|         m_Playable.Blend(stateName, targetWeight,  fadeLength); | ||||
|     } | ||||
|  | ||||
|     public void CrossFade(string stateName, float fadeLength) | ||||
|     { | ||||
|         m_Animator.enabled = true; | ||||
|         Kick(); | ||||
|         m_Playable.Crossfade(stateName, fadeLength); | ||||
|     } | ||||
|  | ||||
|     public void CrossFadeQueued(string stateName, float fadeLength, QueueMode queueMode) | ||||
|     { | ||||
|         m_Animator.enabled = true; | ||||
|         Kick(); | ||||
|         m_Playable.CrossfadeQueued(stateName, fadeLength, queueMode); | ||||
|     } | ||||
|  | ||||
|     public int GetClipCount() | ||||
|     { | ||||
|         return m_Playable.GetClipCount(); | ||||
|     } | ||||
|  | ||||
|     public bool IsPlaying(string stateName) | ||||
|     { | ||||
|         return m_Playable.IsPlaying(stateName); | ||||
|     } | ||||
|  | ||||
|     public void Stop() | ||||
|     { | ||||
|         m_Playable.StopAll(); | ||||
|     } | ||||
|  | ||||
|     public void Stop(string stateName) | ||||
|     { | ||||
|         m_Playable.Stop(stateName); | ||||
|     } | ||||
|  | ||||
|     public void Sample() | ||||
|     { | ||||
|         m_Graph.Evaluate(); | ||||
|     } | ||||
|  | ||||
|     public bool Play() | ||||
|     { | ||||
|         m_Animator.enabled = true; | ||||
|         Kick(); | ||||
|         if (m_Clip != null && m_PlayAutomatically) | ||||
|         { | ||||
|             m_Playable.Play(kDefaultStateName); | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     public void AddState(AnimationClip clip, string name) | ||||
|     { | ||||
|         Kick(); | ||||
|         if (m_Playable.AddClip(clip, name)) | ||||
|         { | ||||
|             RebuildStates(); | ||||
|         } | ||||
|          | ||||
|     } | ||||
|  | ||||
|     public void RemoveState(string name) | ||||
|     { | ||||
|         if (m_Playable.RemoveClip(name)) | ||||
|         { | ||||
|             RebuildStates(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public bool Play(string stateName) | ||||
|     { | ||||
|         //Debug.Log("playing " + stateName); | ||||
|         m_Animator.enabled = true; | ||||
|         Kick(); | ||||
|         return m_Playable.Play(stateName); | ||||
|     } | ||||
|  | ||||
|     public void PlayQueued(string stateName, QueueMode queueMode) | ||||
|     { | ||||
|         m_Animator.enabled = true; | ||||
|         Kick(); | ||||
|         m_Playable.PlayQueued(stateName, queueMode); | ||||
|     } | ||||
|  | ||||
|     public void RemoveClip(AnimationClip clip) | ||||
|     { | ||||
|         if (clip == null) | ||||
|             throw new System.NullReferenceException("clip"); | ||||
|  | ||||
|         if ( m_Playable.RemoveClip(clip) ) | ||||
|         { | ||||
|             RebuildStates(); | ||||
|         } | ||||
|         | ||||
|     } | ||||
|  | ||||
|     public void Unwind() | ||||
|     { | ||||
|         Kick(); | ||||
|         m_Playable.Unwind(); | ||||
|     } | ||||
|  | ||||
|     public void Rewind() | ||||
|     { | ||||
|         Kick(); | ||||
|         m_Playable.Rewind(); | ||||
|     } | ||||
|  | ||||
|     public void Rewind(string stateName) | ||||
|     { | ||||
|         Kick(); | ||||
|         m_Playable.Rewind(stateName); | ||||
|     } | ||||
|  | ||||
|     public State GetState(string stateName) | ||||
|     { | ||||
|         SimpleAnimationPlayable.IState state = m_Playable.GetState(stateName); | ||||
|         if (state == null) | ||||
|             return null; | ||||
|  | ||||
|         return new StateImpl(state, this); | ||||
|     } | ||||
|  | ||||
|     public IEnumerable<State> GetStates() | ||||
|     { | ||||
|         return new StateEnumerable(this); | ||||
|     } | ||||
|  | ||||
|     public State this[string name] | ||||
|     { | ||||
|         get { return GetState(name); } | ||||
|     } | ||||
|  | ||||
|     const string kDefaultStateName = "Default"; | ||||
|     private class StateEnumerable : IEnumerable<State> | ||||
|     { | ||||
|         private SimpleAnimation m_Owner; | ||||
|         public StateEnumerable(SimpleAnimation owner) | ||||
|         { | ||||
|             m_Owner = owner; | ||||
|         } | ||||
|  | ||||
|         public IEnumerator<State> GetEnumerator() | ||||
|         { | ||||
|             return new StateEnumerator(m_Owner); | ||||
|         } | ||||
|  | ||||
|         IEnumerator IEnumerable.GetEnumerator() | ||||
|         { | ||||
|             return new StateEnumerator(m_Owner); | ||||
|         } | ||||
|  | ||||
|         class StateEnumerator : IEnumerator<State> | ||||
|         { | ||||
|             private SimpleAnimation m_Owner; | ||||
|             private IEnumerator<SimpleAnimationPlayable.IState> m_Impl; | ||||
|             public StateEnumerator(SimpleAnimation owner) | ||||
|             { | ||||
|                 m_Owner = owner; | ||||
|                 m_Impl = m_Owner.m_Playable.GetStates().GetEnumerator(); | ||||
|                 Reset(); | ||||
|             } | ||||
|  | ||||
|             State GetCurrent() | ||||
|             { | ||||
|                 return new StateImpl(m_Impl.Current, m_Owner); | ||||
|             } | ||||
|  | ||||
|             object IEnumerator.Current { get { return GetCurrent(); } } | ||||
|  | ||||
|             State IEnumerator<State>.Current { get { return GetCurrent(); } } | ||||
|  | ||||
|             public void Dispose() { } | ||||
|  | ||||
|             public bool MoveNext() | ||||
|             { | ||||
|                 return m_Impl.MoveNext(); | ||||
|             } | ||||
|  | ||||
|             public void Reset() | ||||
|             { | ||||
|                 m_Impl.Reset(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     private class StateImpl : State | ||||
|     { | ||||
|         public StateImpl(SimpleAnimationPlayable.IState handle, SimpleAnimation component) | ||||
|         { | ||||
|             m_StateHandle = handle; | ||||
|             m_Component = component; | ||||
|         } | ||||
|  | ||||
|         private SimpleAnimationPlayable.IState m_StateHandle; | ||||
|         private SimpleAnimation m_Component; | ||||
|  | ||||
|         bool State.enabled | ||||
|         { | ||||
|             get { return m_StateHandle.enabled; } | ||||
|             set | ||||
|             { | ||||
|                 m_StateHandle.enabled = value; | ||||
|                 if (value) | ||||
|                 { | ||||
|                     m_Component.Kick(); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         bool State.isValid | ||||
|         { | ||||
|             get { return m_StateHandle.IsValid(); } | ||||
|         } | ||||
|         float State.time | ||||
|         { | ||||
|             get { return m_StateHandle.time; } | ||||
|             set | ||||
|             { | ||||
|                 m_StateHandle.time = value; | ||||
|                 m_Component.Kick(); | ||||
|             } | ||||
|         } | ||||
|         float State.normalizedTime | ||||
|         { | ||||
|             get { return m_StateHandle.normalizedTime; } | ||||
|             set | ||||
|             { | ||||
|                 m_StateHandle.normalizedTime = value; | ||||
|                 m_Component.Kick(); | ||||
|             } | ||||
|         } | ||||
|         float State.speed | ||||
|         { | ||||
|             get { return m_StateHandle.speed; } | ||||
|             set | ||||
|             { | ||||
|                 m_StateHandle.speed = value; | ||||
|                 m_Component.Kick(); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         string State.name | ||||
|         { | ||||
|             get { return m_StateHandle.name; } | ||||
|             set { m_StateHandle.name = value; } | ||||
|         } | ||||
|         float State.weight | ||||
|         { | ||||
|             get { return m_StateHandle.weight; } | ||||
|             set | ||||
|             { | ||||
|                 m_StateHandle.weight = value; | ||||
|                 m_Component.Kick(); | ||||
|             } | ||||
|         } | ||||
|         float State.length | ||||
|         { | ||||
|             get { return m_StateHandle.length; } | ||||
|         } | ||||
|  | ||||
|         AnimationClip State.clip | ||||
|         { | ||||
|             get { return m_StateHandle.clip; } | ||||
|         } | ||||
|  | ||||
|         WrapMode State.wrapMode | ||||
|         { | ||||
|             get { return m_StateHandle.wrapMode; } | ||||
|             set { Debug.LogError("Not Implemented"); } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     [System.Serializable] | ||||
|     public class EditorState | ||||
|     { | ||||
|         public AnimationClip clip; | ||||
|         public string name; | ||||
|         public bool defaultState; | ||||
|     } | ||||
|  | ||||
|     protected void Kick() | ||||
|     { | ||||
|         if (!m_IsPlaying) | ||||
|         { | ||||
|             m_Graph.Play(); | ||||
|             m_IsPlaying = true; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     protected PlayableGraph m_Graph; | ||||
|     protected PlayableHandle m_LayerMixer; | ||||
|     protected PlayableHandle m_TransitionMixer; | ||||
|     protected Animator m_Animator; | ||||
|     protected bool m_Initialized; | ||||
|     protected bool m_IsPlaying; | ||||
|  | ||||
|     protected SimpleAnimationPlayable m_Playable; | ||||
|  | ||||
|     [SerializeField] | ||||
|     protected bool m_PlayAutomatically = true; | ||||
|  | ||||
|     [SerializeField] | ||||
|     protected bool m_AnimatePhysics = false; | ||||
|  | ||||
|     [SerializeField] | ||||
|     protected AnimatorCullingMode m_CullingMode = AnimatorCullingMode.CullUpdateTransforms; | ||||
|  | ||||
|     [SerializeField] | ||||
|     protected WrapMode m_WrapMode; | ||||
|  | ||||
|     [SerializeField] | ||||
|     protected AnimationClip m_Clip; | ||||
|  | ||||
|     [SerializeField] | ||||
|     private EditorState[] m_States; | ||||
|  | ||||
|     protected virtual void OnEnable() | ||||
|     { | ||||
|         Initialize(); | ||||
|         m_Graph.Play(); | ||||
|         if (m_PlayAutomatically) | ||||
|         { | ||||
|             Stop(); | ||||
|             Play(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     protected virtual void OnDisable() | ||||
|     { | ||||
|         if (m_Initialized) | ||||
|         { | ||||
|             Stop(); | ||||
|             m_Graph.Stop(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void Reset() | ||||
|     { | ||||
|         if (m_Graph.IsValid()) | ||||
|             m_Graph.Destroy(); | ||||
|  | ||||
|         m_Initialized = false; | ||||
|     } | ||||
|  | ||||
|     private void Initialize() | ||||
|     { | ||||
|         if (m_Initialized) | ||||
|             return; | ||||
|  | ||||
|         m_Animator = GetComponent<Animator>(); | ||||
|         m_Animator.updateMode = m_AnimatePhysics ? AnimatorUpdateMode.AnimatePhysics : AnimatorUpdateMode.Normal; | ||||
|         m_Animator.cullingMode = m_CullingMode; | ||||
|         m_Graph = PlayableGraph.Create(); | ||||
|         m_Graph.SetTimeUpdateMode(DirectorUpdateMode.GameTime); | ||||
|         SimpleAnimationPlayable template = new SimpleAnimationPlayable(); | ||||
|  | ||||
|         var playable = ScriptPlayable<SimpleAnimationPlayable>.Create(m_Graph, template, 1); | ||||
|         m_Playable = playable.GetBehaviour(); | ||||
|         m_Playable.onDone += OnPlayableDone; | ||||
|         if (m_States == null) | ||||
|         { | ||||
|             m_States = new EditorState[1]; | ||||
|             m_States[0] = new EditorState(); | ||||
|             m_States[0].defaultState = true; | ||||
|             m_States[0].name = "Default"; | ||||
|         } | ||||
|  | ||||
|  | ||||
|         if (m_States != null) | ||||
|         { | ||||
|             foreach (var state in m_States) | ||||
|             { | ||||
|                 if (state.clip) | ||||
|                 { | ||||
|                     m_Playable.AddClip(state.clip, state.name); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         EnsureDefaultStateExists(); | ||||
|  | ||||
|         AnimationPlayableUtilities.Play(m_Animator, m_Playable.playable, m_Graph); | ||||
|         Play(); | ||||
|         Kick(); | ||||
|         m_Initialized = true; | ||||
|     } | ||||
|  | ||||
|     private void EnsureDefaultStateExists() | ||||
|     { | ||||
|         if (m_Playable != null && m_Clip != null && m_Playable.GetState(kDefaultStateName) == null) | ||||
|         { | ||||
|             m_Playable.AddClip(m_Clip, kDefaultStateName); | ||||
|             Kick(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     protected virtual void Awake() | ||||
|     { | ||||
|         Initialize(); | ||||
|     } | ||||
|  | ||||
|     protected void OnDestroy() | ||||
|     { | ||||
|         if (m_Graph.IsValid()) | ||||
|         { | ||||
|             m_Graph.Destroy(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void OnPlayableDone() | ||||
|     { | ||||
|         m_Graph.Stop(); | ||||
|         m_IsPlaying = false; | ||||
|     } | ||||
|  | ||||
|     private void RebuildStates() | ||||
|     { | ||||
|         var playableStates = GetStates(); | ||||
|         var list = new List<EditorState>(); | ||||
|         foreach (var state in playableStates) | ||||
|         { | ||||
|             var newState = new EditorState(); | ||||
|             newState.clip = state.clip; | ||||
|             newState.name = state.name; | ||||
|             list.Add(newState); | ||||
|         } | ||||
|         m_States = list.ToArray(); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										12
									
								
								Assets/KF3/Scripts/SimpleAnimation.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Assets/KF3/Scripts/SimpleAnimation.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 3759e2aae0f7b9a47bb98fc64bf3c543 | ||||
| timeCreated: 1493315774 | ||||
| licenseType: Pro | ||||
| MonoImporter: | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										764
									
								
								Assets/KF3/Scripts/SimpleAnimationPlayable.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										764
									
								
								Assets/KF3/Scripts/SimpleAnimationPlayable.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,764 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
| using UnityEngine.Playables; | ||||
| using UnityEngine.Animations; | ||||
| using System; | ||||
|  | ||||
| public partial class SimpleAnimationPlayable : PlayableBehaviour | ||||
| { | ||||
|     LinkedList<QueuedState> m_StateQueue; | ||||
|     StateManagement m_States; | ||||
|     bool m_Initialized; | ||||
|  | ||||
|     bool m_KeepStoppedPlayablesConnected = true; | ||||
|     public bool keepStoppedPlayablesConnected | ||||
|     { | ||||
|         get { return m_KeepStoppedPlayablesConnected; } | ||||
|         set | ||||
|         { | ||||
|             if (value != m_KeepStoppedPlayablesConnected) | ||||
|             { | ||||
|                 m_KeepStoppedPlayablesConnected = value; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     void UpdateStoppedPlayablesConnections() | ||||
|     { | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             StateInfo state = m_States[i]; | ||||
|             if (state == null) | ||||
|                 continue; | ||||
|             if (state.enabled) | ||||
|                 continue; | ||||
|             if (keepStoppedPlayablesConnected) | ||||
|             { | ||||
|                 ConnectInput(state.index); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 DisconnectInput(state.index); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     protected Playable m_ActualPlayable; | ||||
|     protected Playable self { get { return m_ActualPlayable; } } | ||||
|     public Playable playable { get { return self; } } | ||||
|     protected PlayableGraph graph { get { return self.GetGraph(); } } | ||||
|  | ||||
|     AnimationMixerPlayable m_Mixer; | ||||
|  | ||||
|     public System.Action onDone = null; | ||||
|     public SimpleAnimationPlayable() | ||||
|     { | ||||
|         m_States = new StateManagement(); | ||||
|         this.m_StateQueue = new LinkedList<QueuedState>(); | ||||
|     } | ||||
|  | ||||
|     public Playable GetInput(int index) | ||||
|     { | ||||
|         if (index >= m_Mixer.GetInputCount()) | ||||
|             return Playable.Null; | ||||
|  | ||||
|         return m_Mixer.GetInput(index); | ||||
|     } | ||||
|  | ||||
|     public override void OnPlayableCreate(Playable playable) | ||||
|     { | ||||
|         m_ActualPlayable = playable; | ||||
|  | ||||
|         var mixer = AnimationMixerPlayable.Create(graph, 1, true); | ||||
|         m_Mixer = mixer; | ||||
|  | ||||
|         self.SetInputCount(1); | ||||
|         self.SetInputWeight(0, 1); | ||||
|         graph.Connect(m_Mixer, 0, self, 0); | ||||
|     } | ||||
|  | ||||
|     public IEnumerable<IState> GetStates() | ||||
|     { | ||||
|         return new StateEnumerable(this); | ||||
|     } | ||||
|  | ||||
|     public IState GetState(string name) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state == null) | ||||
|         { | ||||
|             return null; | ||||
|         } | ||||
|  | ||||
|         return new StateHandle(this, state.index, state.playable); | ||||
|     } | ||||
|  | ||||
|     private StateInfo DoAddClip(string name, AnimationClip clip) | ||||
|     { | ||||
|         //Start new State | ||||
|         StateInfo newState = m_States.InsertState(); | ||||
|         newState.Initialize(name, clip, clip.wrapMode); | ||||
|         //Find at which input the state will be connected | ||||
|         int index = newState.index; | ||||
|  | ||||
|         //Increase input count if needed | ||||
|         if (index == m_Mixer.GetInputCount()) | ||||
|         { | ||||
|             m_Mixer.SetInputCount(index + 1); | ||||
|         } | ||||
|  | ||||
|         var clipPlayable = AnimationClipPlayable.Create(graph, clip); | ||||
|         clipPlayable.SetApplyFootIK(false); | ||||
|         clipPlayable.SetApplyPlayableIK(false); | ||||
|         if (!clip.isLooping || newState.wrapMode == WrapMode.Once) | ||||
|         { | ||||
|             clipPlayable.SetDuration(clip.length); | ||||
|         } | ||||
|         newState.SetPlayable(clipPlayable); | ||||
|         newState.Pause(); | ||||
|  | ||||
|         if (keepStoppedPlayablesConnected) | ||||
|             ConnectInput(newState.index); | ||||
|  | ||||
|         return newState; | ||||
|     } | ||||
|  | ||||
|     public bool AddClip(AnimationClip clip, string name) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state != null) | ||||
|         { | ||||
|             Debug.LogError(string.Format("Cannot add state with name {0}, because a state with that name already exists", name)); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         DoAddClip(name, clip); | ||||
|         UpdateDoneStatus(); | ||||
|         InvalidateStates(); | ||||
|  | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public bool RemoveClip(string name) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state == null) | ||||
|         { | ||||
|             Debug.LogError(string.Format("Cannot remove state with name {0}, because a state with that name doesn't exist", name)); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         RemoveClones(state); | ||||
|         InvalidateStates(); | ||||
|         m_States.RemoveState(state.index); | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public bool RemoveClip(AnimationClip clip) | ||||
|     { | ||||
|         InvalidateStates(); | ||||
|         return m_States.RemoveClip(clip); | ||||
|     } | ||||
|  | ||||
|     public bool Play(string name) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state == null) | ||||
|         { | ||||
|             Debug.LogError(string.Format("Cannot play state with name {0} because there is no state with that name", name)); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         return Play(state.index); | ||||
|     } | ||||
|  | ||||
|     private bool Play(int index) | ||||
|     { | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             StateInfo state = m_States[i]; | ||||
|             if(state == null) { continue; } | ||||
|             if (state.index == index) | ||||
|             { | ||||
|                 state.Enable(); | ||||
|                 state.ForceWeight(1.0f); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 DoStop(i); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public bool PlayQueued(string name, QueueMode queueMode) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state == null) | ||||
|         { | ||||
|             Debug.LogError(string.Format("Cannot queue Play to state with name {0} because there is no state with that name", name)); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         return PlayQueued(state.index, queueMode); | ||||
|     } | ||||
|  | ||||
|     bool PlayQueued(int index, QueueMode queueMode) | ||||
|     { | ||||
|         StateInfo newState = CloneState(index); | ||||
|  | ||||
|         if (queueMode == QueueMode.PlayNow) | ||||
|         { | ||||
|             Play(newState.index); | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         m_StateQueue.AddLast(new QueuedState(StateInfoToHandle(newState), 0f)); | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public void Rewind(string name) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state == null) | ||||
|         { | ||||
|             Debug.LogError(string.Format("Cannot Rewind state with name {0} because there is no state with that name", name)); | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         Rewind(state.index); | ||||
|     } | ||||
|  | ||||
|     private void Rewind(int index) | ||||
|     { | ||||
|         m_States.SetStateTime(index, 0f); | ||||
|     } | ||||
|  | ||||
|     public void Unwind() | ||||
|     { | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             if (m_States[i] != null) | ||||
|                 m_States.SetStateTime(i, 1f); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void Rewind() | ||||
|     { | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             if (m_States[i] != null) | ||||
|                 m_States.SetStateTime(i, 0f); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void RemoveClones(StateInfo state) | ||||
|     { | ||||
|         var it = m_StateQueue.First; | ||||
|         while (it != null) | ||||
|         { | ||||
|             var next = it.Next; | ||||
|  | ||||
|             StateInfo queuedState = m_States[it.Value.state.index]; | ||||
|             if (queuedState.parentState.index == state.index) | ||||
|             { | ||||
|                 m_StateQueue.Remove(it); | ||||
|                 DoStop(queuedState.index); | ||||
|             } | ||||
|  | ||||
|             it = next; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public bool Stop(string name) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state == null) | ||||
|         { | ||||
|             Debug.LogError(string.Format("Cannot stop state with name {0} because there is no state with that name", name)); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         DoStop(state.index); | ||||
|  | ||||
|         UpdateDoneStatus(); | ||||
|  | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     private void DoStop(int index) | ||||
|     { | ||||
|         StateInfo state = m_States[index]; | ||||
|         if (state == null) | ||||
|             return; | ||||
|         m_States.StopState(index, state.isClone); | ||||
|         if (!state.isClone) | ||||
|         { | ||||
|             RemoveClones(state); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public bool StopAll() | ||||
|     { | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             DoStop(i); | ||||
|         } | ||||
|  | ||||
|         playable.SetDone(true); | ||||
|  | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public bool IsPlaying() | ||||
|     { | ||||
|         return m_States.AnyStatePlaying(); | ||||
|     } | ||||
|  | ||||
|     public bool IsPlaying(string stateName) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(stateName); | ||||
|         if (state == null) | ||||
|             return false; | ||||
|  | ||||
|         return state.enabled || IsClonePlaying(state); | ||||
|     } | ||||
|  | ||||
|     private bool IsClonePlaying(StateInfo state) | ||||
|     { | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             StateInfo otherState = m_States[i]; | ||||
|             if (otherState == null) | ||||
|                 continue; | ||||
|  | ||||
|             if (otherState.isClone && otherState.enabled && otherState.parentState.index == state.index) | ||||
|             { | ||||
|                 return true; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     public int GetClipCount() | ||||
|     { | ||||
|         int count=0; | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             if (m_States[i] != null) | ||||
|             { | ||||
|                 count++; | ||||
|             } | ||||
|         } | ||||
|         return count; | ||||
|     } | ||||
|  | ||||
|     private void SetupLerp(StateInfo state, float targetWeight, float time) | ||||
|     { | ||||
|         float travel = Mathf.Abs(state.weight - targetWeight); | ||||
|         float newSpeed = time != 0f ? travel / time : Mathf.Infinity; | ||||
|  | ||||
|         // If we're fading to the same target as before but slower, assume CrossFade was called multiple times and ignore new speed | ||||
|         if (state.fading && Mathf.Approximately(state.targetWeight, targetWeight) && newSpeed < state.fadeSpeed) | ||||
|             return; | ||||
|  | ||||
|         state.FadeTo(targetWeight, newSpeed); | ||||
|     } | ||||
|  | ||||
|     private bool Crossfade(int index, float time) | ||||
|     { | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             StateInfo state = m_States[i]; | ||||
|             if (state == null) | ||||
|                 continue; | ||||
|  | ||||
|             if (state.index == index) | ||||
|             { | ||||
|                 m_States.EnableState(index); | ||||
|             } | ||||
|  | ||||
|             if (state.enabled == false) | ||||
|                 continue; | ||||
|  | ||||
|             float targetWeight = state.index == index ? 1.0f : 0.0f; | ||||
|             SetupLerp(state, targetWeight, time); | ||||
|         } | ||||
|  | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     private StateInfo CloneState(int index) | ||||
|     { | ||||
|         StateInfo original = m_States[index]; | ||||
|         string newName = original.stateName + "Queued Clone"; | ||||
|         StateInfo clone = DoAddClip(newName, original.clip); | ||||
|         clone.SetAsCloneOf(new StateHandle(this, original.index, original.playable)); | ||||
|         return clone; | ||||
|     } | ||||
|  | ||||
|     public bool Crossfade(string name, float time) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state == null) | ||||
|         { | ||||
|             Debug.LogError(string.Format("Cannot crossfade to state with name {0} because there is no state with that name", name)); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         if (time == 0f) | ||||
|             return Play(state.index); | ||||
|  | ||||
|         return Crossfade(state.index, time); | ||||
|     } | ||||
|  | ||||
|     public bool CrossfadeQueued(string name, float time, QueueMode queueMode) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state == null) | ||||
|         { | ||||
|             Debug.LogError(string.Format("Cannot queue crossfade to state with name {0} because there is no state with that name", name)); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         return CrossfadeQueued(state.index, time, queueMode); | ||||
|     } | ||||
|  | ||||
|     private bool CrossfadeQueued(int index, float time, QueueMode queueMode) | ||||
|     { | ||||
|         StateInfo newState = CloneState(index); | ||||
|  | ||||
|         if (queueMode == QueueMode.PlayNow) | ||||
|         { | ||||
|             Crossfade(newState.index, time); | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         m_StateQueue.AddLast(new QueuedState(StateInfoToHandle(newState), time)); | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     private bool Blend(int index, float targetWeight, float time) | ||||
|     { | ||||
|         StateInfo state = m_States[index]; | ||||
|         if (state.enabled == false) | ||||
|             m_States.EnableState(index); | ||||
|  | ||||
|         if (time == 0f) | ||||
|         { | ||||
|             state.ForceWeight(targetWeight); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             SetupLerp(state, targetWeight, time); | ||||
|         } | ||||
|  | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public bool Blend(string name, float targetWeight, float time) | ||||
|     { | ||||
|         StateInfo state = m_States.FindState(name); | ||||
|         if (state == null) | ||||
|         { | ||||
|             Debug.LogError(string.Format("Cannot blend state with name {0} because there is no state with that name", name)); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         return Blend(state.index, targetWeight, time); | ||||
|     } | ||||
|  | ||||
|     public override void OnGraphStop(Playable playable) | ||||
|     { | ||||
|         //if the playable is not valid, then we are destroying, and our children won't be valid either | ||||
|         if (!self.IsValid()) | ||||
|             return; | ||||
|  | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             StateInfo state = m_States[i]; | ||||
|             if (state == null) | ||||
|                 continue; | ||||
|  | ||||
|             if (state.fadeSpeed == 0f && state.targetWeight == 0f) | ||||
|             { | ||||
|                 Playable input = m_Mixer.GetInput(state.index); | ||||
|                 if (!input.Equals(Playable.Null)) | ||||
|                 { | ||||
|                     input.ResetTime(0f); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void UpdateDoneStatus() | ||||
|     { | ||||
|         if (!m_States.AnyStatePlaying()) | ||||
|         { | ||||
|             bool wasDone = playable.IsDone(); | ||||
|             playable.SetDone(true); | ||||
|             if (!wasDone && onDone != null) | ||||
|             { | ||||
|                 onDone(); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     private void CleanClonedStates() | ||||
|     { | ||||
|         for (int i = m_States.Count-1; i >= 0; i--) | ||||
|         { | ||||
|             StateInfo state = m_States[i]; | ||||
|             if (state == null) | ||||
|                 continue; | ||||
|  | ||||
|             if (state.isReadyForCleanup) | ||||
|             { | ||||
|                 Playable toDestroy = m_Mixer.GetInput(state.index); | ||||
|                 graph.Disconnect(m_Mixer, state.index); | ||||
|                 graph.DestroyPlayable(toDestroy); | ||||
|                 m_States.RemoveState(i); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void DisconnectInput(int index) | ||||
|     { | ||||
|         if (keepStoppedPlayablesConnected) | ||||
|         { | ||||
|             m_States[index].Pause(); | ||||
|         } | ||||
|         graph.Disconnect(m_Mixer, index); | ||||
|     } | ||||
|  | ||||
|     private void ConnectInput(int index) | ||||
|     { | ||||
|         StateInfo state = m_States[index]; | ||||
|         graph.Connect(state.playable, 0, m_Mixer, state.index); | ||||
|     } | ||||
|  | ||||
|     private void UpdateStates(float deltaTime) | ||||
|     { | ||||
|         bool mustUpdateWeights = false; | ||||
|         float totalWeight = 0f; | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             StateInfo state = m_States[i]; | ||||
|  | ||||
|             //Skip deleted states | ||||
|             if (state == null) | ||||
|             { | ||||
|                 continue; | ||||
|             } | ||||
|  | ||||
|             //Update crossfade weight | ||||
|             if (state.fading) | ||||
|             { | ||||
|                 state.SetWeight(Mathf.MoveTowards(state.weight, state.targetWeight, state.fadeSpeed *deltaTime)); | ||||
|                 if (Mathf.Approximately(state.weight, state.targetWeight)) | ||||
|                 { | ||||
|                     state.ForceWeight(state.targetWeight); | ||||
|                     if (state.weight == 0f) | ||||
|                     { | ||||
|                         state.Stop(); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             if (state.enabledDirty) | ||||
|             { | ||||
|                 if (state.enabled) | ||||
|                     state.Play(); | ||||
|                 else | ||||
|                     state.Pause(); | ||||
|  | ||||
|                 if (!keepStoppedPlayablesConnected) | ||||
|                 { | ||||
|                     Playable input = m_Mixer.GetInput(i); | ||||
|                     //if state is disabled but the corresponding input is connected, disconnect it | ||||
|                     if (input.IsValid() && !state.enabled) | ||||
|                     { | ||||
|                         DisconnectInput(i); | ||||
|                     } | ||||
|                     else if (state.enabled && !input.IsValid()) | ||||
|                     { | ||||
|                         ConnectInput(state.index); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             if (state.enabled && state.wrapMode == WrapMode.Once) | ||||
|             { | ||||
|                 bool stateIsDone = state.isDone; | ||||
|                 float speed = state.speed; | ||||
|                 float time = state.GetTime(); | ||||
|                 float duration = state.playableDuration; | ||||
|  | ||||
|                 stateIsDone |= speed < 0f && time < 0f; | ||||
|                 stateIsDone |= speed >= 0f && time >= duration; | ||||
|                 if (stateIsDone) | ||||
|                 { | ||||
|                     state.Stop(); | ||||
|                     state.Disable(); | ||||
|                     if (!keepStoppedPlayablesConnected) | ||||
|                         DisconnectInput(state.index); | ||||
|  | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             totalWeight += state.weight; | ||||
|             if (state.weightDirty) | ||||
|             { | ||||
|                 mustUpdateWeights = true; | ||||
|             } | ||||
|             state.ResetDirtyFlags(); | ||||
|         } | ||||
|  | ||||
|         if (mustUpdateWeights) | ||||
|         { | ||||
|             bool hasAnyWeight = totalWeight > 0.0f; | ||||
|             for (int i = 0; i < m_States.Count; i++) | ||||
|             { | ||||
|                 StateInfo state = m_States[i]; | ||||
|                 if (state == null) | ||||
|                     continue; | ||||
|  | ||||
|                 float weight = hasAnyWeight ? state.weight / totalWeight : 0.0f; | ||||
|                 m_Mixer.SetInputWeight(state.index, weight); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private float CalculateQueueTimes() | ||||
|     { | ||||
|         float longestTime = -1f; | ||||
|  | ||||
|         for (int i = 0; i < m_States.Count; i++) | ||||
|         { | ||||
|             StateInfo state = m_States[i]; | ||||
|             //Skip deleted states | ||||
|             if (state == null || !state.enabled || !state.playable.IsValid()) | ||||
|                 continue; | ||||
|  | ||||
|             if (state.wrapMode == WrapMode.Loop) | ||||
|             { | ||||
|                 return Mathf.Infinity; | ||||
|             } | ||||
|  | ||||
|             float speed = state.speed; | ||||
|             float stateTime = m_States.GetStateTime(state.index); | ||||
|             float remainingTime; | ||||
|             if (speed > 0 ) | ||||
|             { | ||||
|                 remainingTime = (state.clip.length - stateTime) / speed; | ||||
|             } | ||||
|             else if(speed < 0 ) | ||||
|             { | ||||
|                 remainingTime = (stateTime) / speed; | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 remainingTime = Mathf.Infinity; | ||||
|             } | ||||
|  | ||||
|             if (remainingTime > longestTime) | ||||
|             { | ||||
|                 longestTime = remainingTime; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return longestTime; | ||||
|     } | ||||
|  | ||||
|     private void ClearQueuedStates() | ||||
|     { | ||||
|         using (var it = m_StateQueue.GetEnumerator()) | ||||
|         { | ||||
|             while (it.MoveNext()) | ||||
|             { | ||||
|                 QueuedState queuedState = it.Current; | ||||
|                 m_States.StopState(queuedState.state.index, true); | ||||
|             } | ||||
|         } | ||||
|         m_StateQueue.Clear(); | ||||
|     } | ||||
|  | ||||
|     private void UpdateQueuedStates() | ||||
|     { | ||||
|         bool mustCalculateQueueTimes = true; | ||||
|         float remainingTime = -1f; | ||||
|  | ||||
|         var it = m_StateQueue.First; | ||||
|         while(it != null) | ||||
|         { | ||||
|             if (mustCalculateQueueTimes) | ||||
|             { | ||||
|                 remainingTime = CalculateQueueTimes(); | ||||
|                 mustCalculateQueueTimes = false; | ||||
|             } | ||||
|  | ||||
|             QueuedState queuedState = it.Value; | ||||
|  | ||||
|             if (queuedState.fadeTime >= remainingTime) | ||||
|             { | ||||
|                 Crossfade(queuedState.state.index, queuedState.fadeTime); | ||||
|                 mustCalculateQueueTimes = true; | ||||
|                 m_StateQueue.RemoveFirst(); | ||||
|                 it = m_StateQueue.First; | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 it = it.Next; | ||||
|             } | ||||
|  | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     void InvalidateStateTimes() | ||||
|     { | ||||
|         int count = m_States.Count; | ||||
|         for (int i = 0; i < count; i++) | ||||
|         { | ||||
|             StateInfo state = m_States[i]; | ||||
|             if (state == null) | ||||
|                 continue; | ||||
|  | ||||
|             state.InvalidateTime(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public override void PrepareFrame(Playable owner, FrameData data) | ||||
|     { | ||||
|         InvalidateStateTimes(); | ||||
|  | ||||
|         UpdateQueuedStates(); | ||||
|  | ||||
|         UpdateStates(data.deltaTime); | ||||
|  | ||||
|         //Once everything is calculated, update done status | ||||
|         UpdateDoneStatus(); | ||||
|  | ||||
|         CleanClonedStates(); | ||||
|     } | ||||
|  | ||||
|     public bool ValidateInput(int index, Playable input) | ||||
|     { | ||||
|         if (!ValidateIndex(index)) | ||||
|             return false; | ||||
|  | ||||
|         StateInfo state = m_States[index]; | ||||
|         if (state == null || !state.playable.IsValid() || state.playable.GetHandle() != input.GetHandle()) | ||||
|             return false; | ||||
|  | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public bool ValidateIndex(int index) | ||||
|     { | ||||
|         return index >= 0 && index < m_States.Count; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										12
									
								
								Assets/KF3/Scripts/SimpleAnimationPlayable.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Assets/KF3/Scripts/SimpleAnimationPlayable.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: e979d7febf8bb72429b0869d1791a78a | ||||
| timeCreated: 1493310304 | ||||
| licenseType: Pro | ||||
| MonoImporter: | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										718
									
								
								Assets/KF3/Scripts/SimpleAnimationPlayable_States.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										718
									
								
								Assets/KF3/Scripts/SimpleAnimationPlayable_States.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,718 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
| using UnityEngine.Playables; | ||||
| using UnityEngine.Animations; | ||||
| using System; | ||||
|  | ||||
| public partial class SimpleAnimationPlayable : PlayableBehaviour | ||||
| { | ||||
|     private int m_StatesVersion = 0; | ||||
|  | ||||
|     private void InvalidateStates() { m_StatesVersion++; } | ||||
|     private class StateEnumerable: IEnumerable<IState> | ||||
|     { | ||||
|         private SimpleAnimationPlayable m_Owner; | ||||
|         public StateEnumerable(SimpleAnimationPlayable owner) | ||||
|         { | ||||
|             m_Owner = owner; | ||||
|         } | ||||
|  | ||||
|         public IEnumerator<IState> GetEnumerator() | ||||
|         { | ||||
|             return new StateEnumerator(m_Owner); | ||||
|         } | ||||
|  | ||||
|         IEnumerator IEnumerable.GetEnumerator() | ||||
|         { | ||||
|             return new StateEnumerator(m_Owner); | ||||
|         } | ||||
|  | ||||
|         class StateEnumerator : IEnumerator<IState> | ||||
|         { | ||||
|             private int m_Index = -1; | ||||
|             private int m_Version; | ||||
|             private SimpleAnimationPlayable m_Owner; | ||||
|             public StateEnumerator(SimpleAnimationPlayable owner) | ||||
|             { | ||||
|                 m_Owner = owner; | ||||
|                 m_Version = m_Owner.m_StatesVersion; | ||||
|                 Reset(); | ||||
|             } | ||||
|  | ||||
|             private bool IsValid() { return m_Owner != null && m_Version == m_Owner.m_StatesVersion; } | ||||
|  | ||||
|             IState GetCurrentHandle(int index) | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new InvalidOperationException("The collection has been modified, this Enumerator is invalid"); | ||||
|  | ||||
|                 if (index < 0 || index >= m_Owner.m_States.Count) | ||||
|                     throw new InvalidOperationException("Enumerator is invalid"); | ||||
|  | ||||
|                 StateInfo state = m_Owner.m_States[index]; | ||||
|                 if (state == null) | ||||
|                     throw new InvalidOperationException("Enumerator is invalid"); | ||||
|  | ||||
|                 return new StateHandle(m_Owner, state.index, state.playable); | ||||
|             } | ||||
|  | ||||
|             object IEnumerator.Current { get { return GetCurrentHandle(m_Index); } } | ||||
|  | ||||
|             IState IEnumerator<IState>.Current { get { return GetCurrentHandle(m_Index); } } | ||||
|  | ||||
|             public void Dispose() { } | ||||
|  | ||||
|             public bool MoveNext() | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new InvalidOperationException("The collection has been modified, this Enumerator is invalid"); | ||||
|  | ||||
|                 do | ||||
|                 { m_Index++; } while (m_Index < m_Owner.m_States.Count && m_Owner.m_States[m_Index] == null); | ||||
|  | ||||
|                 return m_Index < m_Owner.m_States.Count; | ||||
|             } | ||||
|  | ||||
|             public void Reset() | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new InvalidOperationException("The collection has been modified, this Enumerator is invalid"); | ||||
|                 m_Index = -1; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|      | ||||
|     public interface IState | ||||
|     { | ||||
|         bool IsValid(); | ||||
|  | ||||
|         bool enabled { get; set; } | ||||
|  | ||||
|         float time { get; set; } | ||||
|  | ||||
|         float normalizedTime { get; set; } | ||||
|  | ||||
|         float speed { get; set; } | ||||
|  | ||||
|         string name { get; set; } | ||||
|  | ||||
|         float weight { get; set; } | ||||
|  | ||||
|         float length { get; } | ||||
|  | ||||
|         AnimationClip clip { get; } | ||||
|  | ||||
|         WrapMode wrapMode { get; } | ||||
|     } | ||||
|  | ||||
|     public class StateHandle : IState | ||||
|     { | ||||
|         public StateHandle(SimpleAnimationPlayable s, int index, Playable target) | ||||
|         { | ||||
|             m_Parent = s; | ||||
|             m_Index = index; | ||||
|             m_Target = target; | ||||
|         } | ||||
|  | ||||
|         public bool IsValid() | ||||
|         { | ||||
|             return m_Parent.ValidateInput(m_Index, m_Target); | ||||
|         } | ||||
|  | ||||
|         public bool enabled | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 return m_Parent.m_States[m_Index].enabled; | ||||
|             } | ||||
|  | ||||
|             set | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 if (value) | ||||
|                     m_Parent.m_States.EnableState(m_Index); | ||||
|                 else | ||||
|                     m_Parent.m_States.DisableState(m_Index); | ||||
|  | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public float time | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 return m_Parent.m_States.GetStateTime(m_Index); | ||||
|             } | ||||
|             set | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 m_Parent.m_States.SetStateTime(m_Index, value); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public float normalizedTime | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|  | ||||
|                 float length = m_Parent.m_States.GetClipLength(m_Index); | ||||
|                 if (length == 0f) | ||||
|                     length = 1f; | ||||
|  | ||||
|                 return m_Parent.m_States.GetStateTime(m_Index) / length; | ||||
|             } | ||||
|             set | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|  | ||||
|                 float length = m_Parent.m_States.GetClipLength(m_Index); | ||||
|                 if (length == 0f) | ||||
|                     length = 1f; | ||||
|  | ||||
|                 m_Parent.m_States.SetStateTime(m_Index, value *= length); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public float speed | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 return m_Parent.m_States.GetStateSpeed(m_Index); | ||||
|             } | ||||
|             set | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 m_Parent.m_States.SetStateSpeed(m_Index, value); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public string name | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 return m_Parent.m_States.GetStateName(m_Index); | ||||
|             } | ||||
|             set | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 if (value == null) | ||||
|                     throw new System.ArgumentNullException("A null string is not a valid name"); | ||||
|                 m_Parent.m_States.SetStateName(m_Index, value); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public float weight | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 return m_Parent.m_States[m_Index].weight; | ||||
|             } | ||||
|             set | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 if (value < 0) | ||||
|                     throw new System.ArgumentException("Weights cannot be negative"); | ||||
|  | ||||
|                 m_Parent.m_States.SetInputWeight(m_Index, value); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public float length | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 return m_Parent.m_States.GetStateLength(m_Index); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public AnimationClip clip | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 return m_Parent.m_States.GetStateClip(m_Index); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public WrapMode wrapMode | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 if (!IsValid()) | ||||
|                     throw new System.InvalidOperationException("This StateHandle is not valid"); | ||||
|                 return m_Parent.m_States.GetStateWrapMode(m_Index); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public int index { get { return m_Index; } } | ||||
|  | ||||
|         private SimpleAnimationPlayable m_Parent; | ||||
|         private int m_Index; | ||||
|         private Playable m_Target; | ||||
|     } | ||||
|  | ||||
|     private class StateInfo | ||||
|     { | ||||
|         public void Initialize(string name, AnimationClip clip, WrapMode wrapMode) | ||||
|         { | ||||
|             m_StateName = name; | ||||
|             m_Clip = clip; | ||||
|             m_WrapMode = wrapMode; | ||||
|         } | ||||
|  | ||||
|         public float GetTime() | ||||
|         { | ||||
|             if (m_TimeIsUpToDate) | ||||
|                 return m_Time; | ||||
|  | ||||
|             m_Time = (float)m_Playable.GetTime(); | ||||
|             m_TimeIsUpToDate = true; | ||||
|             return m_Time; | ||||
|         } | ||||
|  | ||||
|         public void SetTime(float newTime) | ||||
|         { | ||||
|             m_Time = newTime; | ||||
|             m_Playable.ResetTime(m_Time); | ||||
|             m_Playable.SetDone(m_Time >= m_Playable.GetDuration()); | ||||
|         } | ||||
|  | ||||
|         public void Enable() | ||||
|         { | ||||
|             if (m_Enabled) | ||||
|                 return; | ||||
|  | ||||
|             m_EnabledDirty = true; | ||||
|             m_Enabled = true; | ||||
|         } | ||||
|  | ||||
|         public void Disable() | ||||
|         { | ||||
|             if (m_Enabled == false) | ||||
|                 return; | ||||
|  | ||||
|             m_EnabledDirty = true; | ||||
|             m_Enabled = false; | ||||
|         } | ||||
|  | ||||
|         public void Pause() | ||||
|         { | ||||
|             m_Playable.SetPlayState(PlayState.Paused); | ||||
|         } | ||||
|  | ||||
|         public void Play() | ||||
|         { | ||||
|             m_Playable.SetPlayState(PlayState.Playing); | ||||
|         } | ||||
|  | ||||
|         public void Stop() | ||||
|         { | ||||
|             m_FadeSpeed = 0f; | ||||
|             ForceWeight(0.0f); | ||||
|             Disable(); | ||||
|             SetTime(0.0f); | ||||
|             m_Playable.SetDone(false); | ||||
|             if (isClone) | ||||
|             { | ||||
|                 m_ReadyForCleanup = true; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public void ForceWeight(float weight) | ||||
|         { | ||||
|            m_TargetWeight = weight; | ||||
|            m_Fading = false; | ||||
|            m_FadeSpeed = 0f; | ||||
|            SetWeight(weight); | ||||
|         } | ||||
|  | ||||
|         public void SetWeight(float weight) | ||||
|         { | ||||
|             m_Weight = weight; | ||||
|             m_WeightDirty = true; | ||||
|         } | ||||
|  | ||||
|         public void FadeTo(float weight, float speed) | ||||
|         { | ||||
|             m_Fading = Mathf.Abs(speed) > 0f; | ||||
|             m_FadeSpeed = speed; | ||||
|             m_TargetWeight = weight; | ||||
|         } | ||||
|  | ||||
|         public void DestroyPlayable() | ||||
|         { | ||||
|             if (m_Playable.IsValid()) | ||||
|             { | ||||
|                 m_Playable.GetGraph().DestroySubgraph(m_Playable); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public void SetAsCloneOf(StateHandle handle) | ||||
|         { | ||||
|             m_ParentState = handle; | ||||
|             m_IsClone = true; | ||||
|         } | ||||
|  | ||||
|         public bool enabled | ||||
|         { | ||||
|             get { return m_Enabled; } | ||||
|         } | ||||
|  | ||||
|         private bool m_Enabled; | ||||
|  | ||||
|         public int index | ||||
|         { | ||||
|             get { return m_Index; } | ||||
|             set | ||||
|             { | ||||
|                 Debug.Assert(m_Index == 0, "Should never reassign Index"); | ||||
|                 m_Index = value; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private int m_Index; | ||||
|  | ||||
|         public string stateName | ||||
|         { | ||||
|             get { return m_StateName; } | ||||
|             set { m_StateName = value; } | ||||
|         } | ||||
|  | ||||
|         private string m_StateName; | ||||
|  | ||||
|         public bool fading | ||||
|         { | ||||
|             get { return m_Fading; } | ||||
|         } | ||||
|  | ||||
|         private bool m_Fading; | ||||
|  | ||||
|  | ||||
|         private float m_Time; | ||||
|  | ||||
|         public float targetWeight | ||||
|         { | ||||
|             get { return m_TargetWeight; } | ||||
|         } | ||||
|  | ||||
|         private float m_TargetWeight; | ||||
|  | ||||
|         public float weight | ||||
|         { | ||||
|             get { return m_Weight; } | ||||
|         } | ||||
|  | ||||
|         float m_Weight; | ||||
|  | ||||
|         public float fadeSpeed | ||||
|         { | ||||
|             get { return m_FadeSpeed; } | ||||
|         } | ||||
|  | ||||
|         float m_FadeSpeed; | ||||
|  | ||||
|         public float speed | ||||
|         { | ||||
|             get { return (float)m_Playable.GetSpeed(); } | ||||
|             set { m_Playable.SetSpeed(value); } | ||||
|         } | ||||
|  | ||||
|         public float playableDuration | ||||
|         { | ||||
|             get { return (float)m_Playable.GetDuration(); } | ||||
|         } | ||||
|  | ||||
|         public AnimationClip clip | ||||
|         { | ||||
|             get { return m_Clip; } | ||||
|         } | ||||
|  | ||||
|         private AnimationClip m_Clip; | ||||
|  | ||||
|         public void SetPlayable(Playable playable) | ||||
|         { | ||||
|             m_Playable = playable; | ||||
|         } | ||||
|  | ||||
|         public bool isDone { get { return m_Playable.IsDone(); } } | ||||
|  | ||||
|         public Playable playable | ||||
|         { | ||||
|             get { return m_Playable; } | ||||
|         } | ||||
|  | ||||
|         private Playable m_Playable; | ||||
|  | ||||
|         public WrapMode wrapMode | ||||
|         { | ||||
|             get { return m_WrapMode; } | ||||
|         } | ||||
|  | ||||
|         private WrapMode m_WrapMode; | ||||
|  | ||||
|         //Clone information | ||||
|         public bool isClone | ||||
|         { | ||||
|             get { return m_IsClone; } | ||||
|         } | ||||
|  | ||||
|         private bool m_IsClone; | ||||
|  | ||||
|         public bool isReadyForCleanup | ||||
|         { | ||||
|             get { return m_ReadyForCleanup; } | ||||
|         } | ||||
|  | ||||
|         private bool m_ReadyForCleanup; | ||||
|  | ||||
|         public StateHandle parentState | ||||
|         { | ||||
|             get { return m_ParentState; } | ||||
|         } | ||||
|  | ||||
|         public StateHandle m_ParentState; | ||||
|  | ||||
|         public bool enabledDirty { get { return m_EnabledDirty; } } | ||||
|         public bool weightDirty { get { return m_WeightDirty; } } | ||||
|  | ||||
|         public void ResetDirtyFlags() | ||||
|         {  | ||||
|             m_EnabledDirty = false; | ||||
|             m_WeightDirty = false; | ||||
|         } | ||||
|  | ||||
|         private bool m_WeightDirty; | ||||
|         private bool m_EnabledDirty; | ||||
|  | ||||
|         public void InvalidateTime() { m_TimeIsUpToDate = false; } | ||||
|         private bool m_TimeIsUpToDate; | ||||
|     } | ||||
|  | ||||
|     private StateHandle StateInfoToHandle(StateInfo info) | ||||
|     { | ||||
|         return new StateHandle(this, info.index, info.playable); | ||||
|     } | ||||
|  | ||||
|     private class StateManagement | ||||
|     { | ||||
|         private List<StateInfo> m_States; | ||||
|  | ||||
|         public int Count { get { return m_Count; } } | ||||
|  | ||||
|         private int m_Count; | ||||
|  | ||||
|         public StateInfo this[int i] | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 return m_States[i]; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public StateManagement() | ||||
|         { | ||||
|             m_States = new List<StateInfo>(); | ||||
|         } | ||||
|  | ||||
|         public StateInfo InsertState() | ||||
|         { | ||||
|             StateInfo state = new StateInfo(); | ||||
|  | ||||
|             int firstAvailable = m_States.FindIndex(s => s == null); | ||||
|             if (firstAvailable == -1) | ||||
|             { | ||||
|                 firstAvailable = m_States.Count; | ||||
|                 m_States.Add(state); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 m_States.Insert(firstAvailable, state); | ||||
|             } | ||||
|  | ||||
|             state.index = firstAvailable; | ||||
|             m_Count++; | ||||
|             return state; | ||||
|         } | ||||
|         public bool AnyStatePlaying() | ||||
|         { | ||||
|             return m_States.FindIndex(s => s != null && s.enabled) != -1; | ||||
|         } | ||||
|  | ||||
|         public void RemoveState(int index) | ||||
|         { | ||||
|             StateInfo removed = m_States[index]; | ||||
|             m_States[index] = null; | ||||
|             removed.DestroyPlayable(); | ||||
|             m_Count = m_States.Count; | ||||
|         } | ||||
|  | ||||
|         public bool RemoveClip(AnimationClip clip) | ||||
|         { | ||||
|             bool removed = false; | ||||
|             for (int i = 0; i < m_States.Count; i++) | ||||
|             { | ||||
|                 StateInfo state = m_States[i]; | ||||
|                 if (state != null &&state.clip == clip) | ||||
|                 { | ||||
|                     RemoveState(i); | ||||
|                     removed = true; | ||||
|                 } | ||||
|             } | ||||
|             return removed; | ||||
|         } | ||||
|  | ||||
|         public StateInfo FindState(string name) | ||||
|         { | ||||
|             int index = m_States.FindIndex(s => s != null && s.stateName == name); | ||||
|             if (index == -1) | ||||
|                 return null; | ||||
|  | ||||
|             return m_States[index]; | ||||
|         } | ||||
|  | ||||
|         public void EnableState(int index) | ||||
|         { | ||||
|             StateInfo state = m_States[index]; | ||||
|             state.Enable(); | ||||
|         } | ||||
|  | ||||
|         public void DisableState(int index) | ||||
|         { | ||||
|             StateInfo state = m_States[index]; | ||||
|             state.Disable(); | ||||
|         } | ||||
|  | ||||
|         public void SetInputWeight(int index, float weight) | ||||
|         { | ||||
|             StateInfo state = m_States[index]; | ||||
|             state.SetWeight(weight); | ||||
|             | ||||
|         } | ||||
|  | ||||
|         public void SetStateTime(int index, float time) | ||||
|         { | ||||
|             StateInfo state = m_States[index]; | ||||
|             state.SetTime(time); | ||||
|         } | ||||
|  | ||||
|         public float GetStateTime(int index) | ||||
|         { | ||||
|             StateInfo state = m_States[index]; | ||||
|             return state.GetTime(); | ||||
|         } | ||||
|  | ||||
|         public bool IsCloneOf(int potentialCloneIndex, int originalIndex) | ||||
|         { | ||||
|             StateInfo potentialClone = m_States[potentialCloneIndex]; | ||||
|             return potentialClone.isClone && potentialClone.parentState.index == originalIndex; | ||||
|         } | ||||
|  | ||||
|         public float GetStateSpeed(int index) | ||||
|         { | ||||
|             return m_States[index].speed; | ||||
|         } | ||||
|         public void SetStateSpeed(int index, float value) | ||||
|         { | ||||
|             m_States[index].speed = value; | ||||
|         } | ||||
|  | ||||
|         public float GetInputWeight(int index) | ||||
|         { | ||||
|             return m_States[index].weight; | ||||
|         } | ||||
|  | ||||
|         public float GetStateLength(int index) | ||||
|         { | ||||
|             AnimationClip clip = m_States[index].clip; | ||||
|             if (clip == null) | ||||
|                 return 0f; | ||||
|             float speed = m_States[index].speed; | ||||
|             if (speed == 0f) | ||||
|                 return Mathf.Infinity; | ||||
|  | ||||
|             return clip.length / speed; | ||||
|         } | ||||
|  | ||||
|         public float GetClipLength(int index) | ||||
|         { | ||||
|             AnimationClip clip = m_States[index].clip; | ||||
|             if (clip == null) | ||||
|                 return 0f; | ||||
|  | ||||
|             return clip.length; | ||||
|         } | ||||
|  | ||||
|         public float GetStatePlayableDuration(int index) | ||||
|         { | ||||
|             return m_States[index].playableDuration; | ||||
|         } | ||||
|  | ||||
|         public AnimationClip GetStateClip(int index) | ||||
|         { | ||||
|             return m_States[index].clip; | ||||
|         } | ||||
|  | ||||
|         public WrapMode GetStateWrapMode(int index) | ||||
|         { | ||||
|             return m_States[index].wrapMode; | ||||
|         } | ||||
|  | ||||
|         public string GetStateName(int index) | ||||
|         { | ||||
|             return m_States[index].stateName; | ||||
|         } | ||||
|  | ||||
|         public void SetStateName(int index, string name) | ||||
|         { | ||||
|             m_States[index].stateName = name; | ||||
|         } | ||||
|  | ||||
|         public void StopState(int index, bool cleanup) | ||||
|         { | ||||
|             if (cleanup) | ||||
|             { | ||||
|                 RemoveState(index); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 m_States[index].Stop(); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     private struct QueuedState | ||||
|     { | ||||
|         public QueuedState(StateHandle s, float t) | ||||
|         { | ||||
|             state = s; | ||||
|             fadeTime = t; | ||||
|         } | ||||
|  | ||||
|         public StateHandle state; | ||||
|         public float fadeTime; | ||||
|     } | ||||
|  | ||||
| } | ||||
							
								
								
									
										13
									
								
								Assets/KF3/Scripts/SimpleAnimationPlayable_States.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Assets/KF3/Scripts/SimpleAnimationPlayable_States.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: ce4f5507fa3bef446a3981a7e6d2475e | ||||
| timeCreated: 1502387922 | ||||
| licenseType: Pro | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										8
									
								
								Assets/KF3/Scripts/UI.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Assets/KF3/Scripts/UI.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 1c309ee42f2d2314585962b387ee5631 | ||||
| folderAsset: yes | ||||
| DefaultImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										239
									
								
								Assets/KF3/Scripts/UI/SpawnPanel.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										239
									
								
								Assets/KF3/Scripts/UI/SpawnPanel.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,239 @@ | ||||
| using System; | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
| using UnityEngine.UI; | ||||
|  | ||||
| namespace KF3.UI.Panels | ||||
| { | ||||
|     public class SpawnPanel : MonoBehaviour | ||||
|     { | ||||
|         public void Open() { } | ||||
|         public void Close() { } | ||||
|  | ||||
|         public Button FriendSelectButton; | ||||
|         public ScrollRect FriendSelection; | ||||
|  | ||||
|         public Button CeruleanSelectButton; | ||||
|         public ScrollRect CeruleanSelection; | ||||
|  | ||||
|         public Button FurnitureSelectButton; | ||||
|         public ScrollRect FurnitureSelection; | ||||
|  | ||||
|         public Button MiscSelectButton; | ||||
|         public ScrollRect MiscSelection; | ||||
|  | ||||
|         public Button MiracleSelectButton; | ||||
|         public ScrollRect MiracleSelection; | ||||
|  | ||||
|         public List<GameObject> LoadedIcons = new List<GameObject>(); | ||||
|  | ||||
|         private KF3ModelViewerMain _main; | ||||
|  | ||||
|         public void SwitchSpawnerTab(Button button) | ||||
|         { | ||||
|             var buttons = new List<Button>() { FriendSelectButton, CeruleanSelectButton, FurnitureSelectButton, MiscSelectButton, MiracleSelectButton }; | ||||
|             var contents = new List<ScrollRect>() { FriendSelection, CeruleanSelection, FurnitureSelection, MiscSelection, MiracleSelection }; | ||||
|  | ||||
|             for(int i = 0; i < buttons.Count; i++) | ||||
|             { | ||||
|                 var value = buttons[i] == button; | ||||
|                 buttons[i].interactable = !value; | ||||
|                 contents[i].gameObject.SetActive(value); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public IEnumerator LoadAll(KF3ModelViewerMain main) | ||||
|         { | ||||
|             _main = main; | ||||
|             LoadCeruleanIcons(); | ||||
|             _main.StartCoroutine(LoadCharacterIcons()); | ||||
|             _main.StartCoroutine(LoadFurnitureIcons()); | ||||
|             LoadMiscIcons(_main.Assets.GetMisc(), MiscSelection.content); | ||||
|             LoadMiscIcons(_main.Assets.GetMiracles(), MiracleSelection.content); | ||||
|             yield break; | ||||
|         } | ||||
|  | ||||
|         public void FilterIcons(string value) | ||||
|         { | ||||
|             if (String.IsNullOrEmpty(value)) | ||||
|             { | ||||
|                 foreach (var icon in LoadedIcons) | ||||
|                 { | ||||
|                     icon.SetActive(true); | ||||
|                 } | ||||
|             } | ||||
|             else foreach (var icon in LoadedIcons) | ||||
|                 { | ||||
|                     icon.SetActive(icon.GetComponentInChildren<Text>().text.ToUpper().Contains(value.ToUpper())); | ||||
|                 } | ||||
|         } | ||||
|  | ||||
|         private IEnumerator LoadCharacterIcons() | ||||
|         { | ||||
|             var abIcons = _main.Assets.Icons.ToList(); | ||||
|             var abChara = _main.Assets.Characters.ToList(); | ||||
|             int total = abChara.Count; | ||||
|             var tex2D = Resources.Load(Strings.CharaErrorPrefab) as Texture2D; | ||||
|             Dictionary<GameObject, KF3AssetBundle> icons = new Dictionary<GameObject, KF3AssetBundle>(); | ||||
|  | ||||
|             foreach (var bundle in abChara) | ||||
|             { | ||||
|                 KF3AssetBundle b = bundle as KF3AssetBundle; | ||||
|                 string id = b.IdStr; | ||||
|                 int idNum = b.IdNum; | ||||
|                 string displayName = id + "_" + KF3Names.GetCharaName(idNum); | ||||
|  | ||||
|                 var icon = abIcons.FirstOrDefault(ab => ab.FileName == $"icon_chara_{id}.png"); | ||||
|                 if (icon == null) | ||||
|                 { | ||||
|                     icon = abIcons.FirstOrDefault(ab => ab.FileName == $"icon_chara_mini_{id}.png"); | ||||
|                 } | ||||
|  | ||||
|                 GameObject go = Instantiate(_main.Resources.ModelIcon, FriendSelection.content.transform); | ||||
|                 go.name = bundle.FileName; | ||||
|                 go.GetComponentInChildren<Text>().text = displayName; | ||||
|                 go.GetComponentInChildren<Button>().onClick.AddListener(() => | ||||
|                 { | ||||
|                     _main.StartCoroutine(_main.Builder.BuildCharacter(bundle.FileName, bundle.FileName)); | ||||
|                     Close(); | ||||
|                 }); | ||||
|  | ||||
|                 if (icon != null) | ||||
|                 { | ||||
|                     icons.Add(go, icon); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     go.GetComponentInChildren<RawImage>().texture = tex2D; | ||||
|                 } | ||||
|                 LoadedIcons.Add(go); | ||||
|             } | ||||
|  | ||||
|             foreach (var i in icons) | ||||
|             { | ||||
|                 var go = i.Key; | ||||
|                 var icon = i.Value; | ||||
|                 yield return _main.Assets.LoadAsset(icon, (ab) => { | ||||
|                     if (ab != null) | ||||
|                     { | ||||
|                         go.GetComponentInChildren<RawImage>().texture = ab.LoadAsset(ab.GetAllAssetNames()[0]) as Texture2D; | ||||
|                         ab.Unload(false); | ||||
|                     } | ||||
|                     else | ||||
|                     { | ||||
|                         go.GetComponentInChildren<RawImage>().texture = tex2D; | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|  | ||||
|             //Error.Log(Color.green, $"Loaded {loaded}/{total} Character Icons"); | ||||
|         } | ||||
|  | ||||
|         private void LoadCeruleanIcons() | ||||
|         { | ||||
|             var abCell = _main.Assets.CeruleansD.Select(c => c.Value[0]).ToList(); | ||||
|             var tex2D = Resources.Load(Strings.CharaErrorPrefab) as Texture2D; | ||||
|             foreach (var bundle in abCell) | ||||
|             { | ||||
|                 KF3AssetBundle b = bundle; | ||||
|  | ||||
|                 GameObject go = Instantiate(_main.Resources.ModelIcon, CeruleanSelection.content.transform); | ||||
|                 go.name = bundle.FileName; | ||||
|                 go.GetComponentInChildren<Text>().text = bundle.DisplayName; | ||||
|                 go.GetComponentInChildren<Button>().onClick.AddListener(() => | ||||
|                 { | ||||
|                     _main.StartCoroutine(_main.Builder.BuildCerulean(bundle.FileName, bundle.FileName, null)); | ||||
|                     Close(); | ||||
|                 }); | ||||
|                 go.GetComponentInChildren<RawImage>().texture = tex2D; | ||||
|                 LoadedIcons.Add(go); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void LoadMiscIcons(List<KF3AssetBundle> icons, Transform panel) | ||||
|         { | ||||
|             var tex2D = Resources.Load(Strings.CharaErrorPrefab) as Texture2D; | ||||
|             foreach (var bundle in icons) | ||||
|             { | ||||
|                 KF3AssetBundle b = bundle; | ||||
|  | ||||
|                 GameObject go = Instantiate(_main.Resources.ModelIcon, panel); | ||||
|                 go.name = bundle.FileName; | ||||
|                 go.GetComponentInChildren<Text>().text = bundle.DisplayName; | ||||
|                 go.GetComponentInChildren<Button>().onClick.AddListener(() => | ||||
|                 { | ||||
|                     _main.StartCoroutine(_main.Builder.Spawn(bundle)); | ||||
|                     Close(); | ||||
|                 }); | ||||
|                 go.GetComponentInChildren<RawImage>().texture = tex2D; | ||||
|                 LoadedIcons.Add(go); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private IEnumerator LoadFurnitureIcons() | ||||
|         { | ||||
|             var abIcons = _main.Assets.Icons.ToList(); | ||||
|             var abFurniture = _main.Assets.Furniture.ToList(); | ||||
|             var tex2D = Resources.Load(Strings.CharaErrorPrefab) as Texture2D; | ||||
|             Dictionary<GameObject, KF3AssetBundle> icons = new Dictionary<GameObject, KF3AssetBundle>(); | ||||
|  | ||||
|             foreach (var bundle in abFurniture) | ||||
|             { | ||||
|                 string name = bundle.FileName; | ||||
|                 string[] split = name.Split(new char[] { '.', '_' }); | ||||
|                 string id = ""; | ||||
|                 int idNum = -1; | ||||
|                 for (int i = split.Length; i >= 0; i--) | ||||
|                 { | ||||
|                     id = split[split.Length - 3]; | ||||
|                     if (int.TryParse(id, out idNum)) | ||||
|                     { | ||||
|                         break; | ||||
|                     } | ||||
|                 } | ||||
|                 if (idNum == -1) | ||||
|                 { | ||||
|                     continue; | ||||
|                 } | ||||
|  | ||||
|                 var icon = abIcons.FirstOrDefault(ab => ab.FileName == $"icon_item_{id}.png"); | ||||
|  | ||||
|                 GameObject go = Instantiate(_main.Resources.ModelIcon, FurnitureSelection.content.transform); | ||||
|                 go.name = bundle.FileName; | ||||
|                 go.GetComponentInChildren<Text>().text = bundle.DisplayName; | ||||
|                 go.GetComponentInChildren<Button>().onClick.AddListener(() => | ||||
|                 { | ||||
|                     _main.StartCoroutine(_main.Builder.SpawnFurniture(bundle.FileName)); | ||||
|                     Close(); | ||||
|                 }); | ||||
|                 if (icon != null) | ||||
|                 { | ||||
|                     icons.Add(go, icon); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     go.GetComponentInChildren<RawImage>().texture = tex2D; | ||||
|                 } | ||||
|                 LoadedIcons.Add(go); | ||||
|             } | ||||
|  | ||||
|             foreach (var i in icons) | ||||
|             { | ||||
|                 var go = i.Key; | ||||
|                 var icon = i.Value; | ||||
|                 yield return _main.Assets.LoadAsset(icon, (ab) => { | ||||
|                     if (ab == null) | ||||
|                     { | ||||
|                         go.GetComponentInChildren<RawImage>().texture = tex2D; | ||||
|                         return; | ||||
|                     } | ||||
|                     go.GetComponentInChildren<RawImage>().texture = ab.LoadAsset(ab.GetAllAssetNames()[0]) as Texture2D; | ||||
|                     ab.Unload(false); | ||||
|                 }); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/UI/SpawnPanel.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/UI/SpawnPanel.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: dcef769ff1dac2b42ac4b52271712b20 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										177
									
								
								Assets/KF3/Scripts/UI/UIKF3CharacterPanel.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										177
									
								
								Assets/KF3/Scripts/UI/UIKF3CharacterPanel.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,177 @@ | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
| using UnityEngine.UI; | ||||
|  | ||||
| public class UIKF3CharacterPanel : MonoBehaviour | ||||
| { | ||||
|     public KF3CharacterContainer Container; | ||||
|  | ||||
|     public TMPro.TMP_Dropdown | ||||
|         AnimationSetDropdown, | ||||
|         BodyAnimationDropdown, | ||||
|         CostumeDropdown, | ||||
|         EarsAnimationDropdown, | ||||
|         TailAnimationDropdown; | ||||
|  | ||||
|     public ScrollRect WeaponToggle; | ||||
|  | ||||
|     private static KF3ModelViewerMain Main => KF3ModelViewerMain.Instance; | ||||
|  | ||||
|     public static UIKF3CharacterPanel Create(KF3CharacterContainer container) | ||||
|     { | ||||
|         var panel = Instantiate(Main.Resources.Pfb_KF3CharacterPanel, KF3ModelViewerInterface.Instance.DynamicPanels); | ||||
|         panel.Container = container; | ||||
|         panel.Init(); | ||||
|         panel.UpdateSelection(); | ||||
|  | ||||
|         return panel; | ||||
|     } | ||||
|  | ||||
|     public void Init() | ||||
|     { | ||||
|         if (Container as KF3FriendContainer != null) | ||||
|         { | ||||
|             var friend = Container as KF3FriendContainer; | ||||
|             KF3ModelViewerInterface.SetDropdownData(CostumeDropdown, Main.Assets.GetCostumesFromId(Container.ModelId).Select(c => KF3Names.GetDressName(c.DisplayName.Split('_', '.')[2])).ToList()); | ||||
|             KF3ModelViewerInterface.SetDropdownData(AnimationSetDropdown, Main.Assets.AnimationSets.Select(a => a.DisplayName).ToList()); | ||||
|             KF3ModelViewerInterface.SetDropdownData(BodyAnimationDropdown, Container.BodyAnimation.prefabAnimeList.Where(anim => anim.clip != null).Select(kf => kf.name).ToList(), true, true); | ||||
|             KF3ModelViewerInterface.SetDropdownData(EarsAnimationDropdown, friend.EarsAnimation == null ? null : friend.EarsAnimation.prefabAnimeList.Where(anim => anim.clip != null).Select(kf => kf.name).ToList(), true, true); | ||||
|             KF3ModelViewerInterface.SetDropdownData(TailAnimationDropdown, friend.TailAnimation == null ? null : friend.TailAnimation.prefabAnimeList.Where(anim => anim.clip != null).Select(kf => kf.name).ToList(), true, true); | ||||
|  | ||||
|             foreach (Renderer r in friend.Renderers) | ||||
|             { | ||||
|                 UIKF3MorphSlider go = Instantiate(Main.Resources.Pfb_KF3MorphToggle, WeaponToggle.content); | ||||
|                 go.Text.text = KF3CharacterContainerSerializable.GetRendererName(friend, r); | ||||
|                 go.Toggle.isOn = r.enabled; | ||||
|                 go.Toggle.onValueChanged.AddListener((value) => { friend.ToggleRendererVisible(r, value); friend.SetKeyframe(); }); | ||||
|             } | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             var friend = Container as KF3CeruleanContainer; | ||||
|             KF3ModelViewerInterface.SetDropdownData(CostumeDropdown, Main.Assets.GetCeruleans(KF3Names.GetEnemyName(friend.ModelId)).Select(m => m.FileName).ToList()); | ||||
|             KF3ModelViewerInterface.SetDropdownData(AnimationSetDropdown, null); | ||||
|             KF3ModelViewerInterface.SetDropdownData(BodyAnimationDropdown, friend.BodyAnimation.prefabAnimeList.Where(anim => anim.clip != null).Select(kf => kf.name).ToList(), true, true); | ||||
|             KF3ModelViewerInterface.SetDropdownData(EarsAnimationDropdown, null); | ||||
|             KF3ModelViewerInterface.SetDropdownData(TailAnimationDropdown, null); | ||||
|         } | ||||
|  | ||||
|         foreach (var dd in new TMPro.TMP_Dropdown[] { AnimationSetDropdown, BodyAnimationDropdown, CostumeDropdown, EarsAnimationDropdown, TailAnimationDropdown }) | ||||
|         { | ||||
|             foreach (Transform t in dd.transform) | ||||
|             { | ||||
|                 if (t.name == "LeftButton") | ||||
|                 { | ||||
|                     t.gameObject.GetComponent<Button>().onClick.AddListener(() => { ModelViewerInterface.DropdownPrevious(dd); }); | ||||
|                 } | ||||
|                 else if (t.name == "RightButton") | ||||
|                 { | ||||
|                     t.gameObject.GetComponent<Button>().onClick.AddListener(() => { ModelViewerInterface.DropdownNext(dd); }); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void UpdateSelection() | ||||
|     { | ||||
|         string currentAnimation = Container.CurrentAnimation; | ||||
|  | ||||
|         if (currentAnimation == "") | ||||
|         { | ||||
|             BodyAnimationDropdown.SetValueWithoutNotify(0); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             int index = BodyAnimationDropdown.options.IndexOf(BodyAnimationDropdown.options.FirstOrDefault(o => o.text == currentAnimation)); | ||||
|             BodyAnimationDropdown.SetValueWithoutNotify(index); | ||||
|         } | ||||
|  | ||||
|         if (Container as KF3FriendContainer != null) | ||||
|         { | ||||
|             CostumeDropdown.SetValueWithoutNotify(CostumeDropdown.options.IndexOf(CostumeDropdown.options.First(o => o.text == KF3Names.GetDressName(Container.CostumeName.Split('_', '.')[2])))); | ||||
|             EarsAnimationDropdown.SetValueWithoutNotify(0); | ||||
|             TailAnimationDropdown.SetValueWithoutNotify(0); | ||||
|             AnimationSetDropdown.SetValueWithoutNotify(Main.Assets.AnimationSets.IndexOf(Main.Assets.GetAnimationSet(Container.AnimationName))); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             CostumeDropdown.SetValueWithoutNotify(CostumeDropdown.options.IndexOf(CostumeDropdown.options.FirstOrDefault(o => o.text == Container.CostumeName))); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void OnAnimationSetDropdownSelected(int index) | ||||
|     { | ||||
|         //if (index == 0) return; | ||||
|         KF3AssetBundle animations = Main.Assets.GetAnimationSet(AnimationSetDropdown.options[index].text); | ||||
|         List<KF3AssetBundle> costumes = Main.Assets.GetCostumesFromId(Main.SelectedObject.ModelId); | ||||
|  | ||||
|         Main.StartCoroutine(Main.Builder.UpdateCharacter(Container, costumes[CostumeDropdown.value].FileName, animations.FileName)); | ||||
|     } | ||||
|  | ||||
|     public void OnCostumeDropdownSelected(int index) | ||||
|     { | ||||
|         if (Container as KF3FriendContainer != null) | ||||
|         { | ||||
|             List<KF3AssetBundle> costumes = Main.Assets.GetCostumesFromId(Main.SelectedObject.ModelId); | ||||
|             KF3AssetBundle animation = Main.Assets.GetAnimationSet(AnimationSetDropdown.options[AnimationSetDropdown.value].text); | ||||
|             Main.StartCoroutine(Main.Builder.UpdateCharacter(Container, costumes[index].FileName, animation.FileName)); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             //var cells = Main.Assets.GetCeruleans(KF3Names.GetEnemyName(Main.SelectedObject.ModelId)); | ||||
|             //var t = Main.SelectedObject.transform; | ||||
|             //var pos = t.position; | ||||
|             //var rot = t.rotation; | ||||
|             //var siz = t.localScale; | ||||
|             //Destroy(Main.SelectedObject); | ||||
|             //StartCoroutine(Main.ModelBuilder.BuildCerulean(cells[index].FileName, cells[0].FileName, (go) => | ||||
|             //{ | ||||
|             //    t = go.transform; | ||||
|             //    t.position = pos; | ||||
|             //    t.rotation = rot; | ||||
|             //    t.localScale = siz; | ||||
|             //})); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public void OnBodyAnimationDropdownSelected(int index) | ||||
|     { | ||||
|         Debug.Log("Click"); | ||||
|         if (index == 0) | ||||
|         { | ||||
|             Container.CurrentAnimation = ""; | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Container.CurrentAnimation = BodyAnimationDropdown.options[index].text; | ||||
|         } | ||||
|         Container.SetKeyframe(); | ||||
|         TimelineController.SetCurrentFrame(Container); | ||||
|         Container.SetKeyframe(); | ||||
|     } | ||||
|  | ||||
|     public void OnEarsAnimationDropdownSelected(int index) | ||||
|     { | ||||
|         var friend = Container as KF3FriendContainer; | ||||
|         if (friend == null) return; | ||||
|         if (index == 0) | ||||
|         { | ||||
|             friend.PlayEarsAnimation(""); | ||||
|             return; | ||||
|         } | ||||
|         friend.PlayEarsAnimation(EarsAnimationDropdown.options[index].text); | ||||
|     } | ||||
|  | ||||
|     public void OnTailAnimationDropdownSelected(int index) | ||||
|     { | ||||
|         var friend = Container as KF3FriendContainer; | ||||
|         if (friend == null) return; | ||||
|         if (index == 0) | ||||
|         { | ||||
|             friend.PlayTailAnimation(""); | ||||
|             return; | ||||
|         } | ||||
|         friend.PlayTailAnimation(TailAnimationDropdown.options[index].text); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3CharacterPanel.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3CharacterPanel.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: c0edd5564ed877d428ef35ddeb40ba16 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										25
									
								
								Assets/KF3/Scripts/UI/UIKF3Container.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								Assets/KF3/Scripts/UI/UIKF3Container.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| using TMPro; | ||||
| using UnityEngine; | ||||
| using UnityEngine.Events; | ||||
| using UnityEngine.UI; | ||||
|  | ||||
| public class UIKF3Container : MonoBehaviour | ||||
| { | ||||
|     public Button Button; | ||||
|     public RawImage RawImage; | ||||
|     public TextMeshProUGUI Label; | ||||
|  | ||||
|     public UIKF3Container SetNames(string name, string label, Texture2D icon) | ||||
|     { | ||||
|         gameObject.name = name; | ||||
|         Label.text = label; | ||||
|         RawImage.texture = icon; | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
|     public UIKF3Container AddCallback(UnityAction action) | ||||
|     { | ||||
|         Button.onClick.AddListener(action); | ||||
|         return this; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3Container.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3Container.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 6a78bbcf1fa1e924595665b866401df5 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										139
									
								
								Assets/KF3/Scripts/UI/UIKF3MorphPanel.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										139
									
								
								Assets/KF3/Scripts/UI/UIKF3MorphPanel.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,139 @@ | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
| using UnityEngine.UI; | ||||
|  | ||||
| public class UIKF3MorphPanel : MonoBehaviour | ||||
| { | ||||
|     public Transform | ||||
|         EyesPanel, | ||||
|         EyebrowsPanel, | ||||
|         MouthPanel; | ||||
|  | ||||
|     public ToggleGroup EyesToggleGroup; | ||||
|  | ||||
|     public static UIKF3MorphPanel Create(KF3FriendContainer container) | ||||
|     { | ||||
|         var main = KF3ModelViewerMain.Instance; | ||||
|         var morphPanel = Instantiate(main.Resources.Pfb_KF3MorphPanel, main.UI.DynamicPanels); | ||||
|         //morphPanel.Init(container); | ||||
|         return morphPanel; | ||||
|     } | ||||
|  | ||||
|     //public void Init(KF3FriendContainer container) | ||||
|     //{ | ||||
|     //    foreach (Transform child in container.GetComponentsInChildren<Transform>()) | ||||
|     //    { | ||||
|     //        GameObject go = null; | ||||
|     //        switch (child.name) | ||||
|     //        { | ||||
|     //            case "md_eye_base": | ||||
|     //                { | ||||
|     //                    go = Instantiate(KF3ModelViewerInterface.Instance.Pfb_MorphSliderToggle, EyesPanel); | ||||
|     //                    go.GetChild<Text>().text = "Look At Camera"; | ||||
|     //                    go.Get<Slider>().wholeNumbers = false; | ||||
|     //                    go.Get<Slider>().minValue = 0; | ||||
|     //                    go.Get<Slider>().maxValue = 1; | ||||
|     //                    go.Get<Slider>().value = container.LookAtStrength; | ||||
|     //                    go.Get<Slider>().onValueChanged.AddListener((value) => { container.UpdateLookAtTarget(value); }); | ||||
|     //                    go.GetChild<Toggle>().isOn = container.EyesLocked; | ||||
|     //                    go.GetChild<Toggle>().onValueChanged.AddListener((val) => container.EyesLocked = val); | ||||
|  | ||||
|     //                    SkinnedMeshRenderer meshRenderer = child.GetComponent<SkinnedMeshRenderer>(); | ||||
|     //                    if (meshRenderer == null) break; | ||||
|     //                    if (meshRenderer.sharedMesh == null) break; | ||||
|     //                    for (int i = 0; i < meshRenderer.sharedMesh.blendShapeCount; i++) | ||||
|     //                    { | ||||
|     //                        CreateMorph(meshRenderer, EyesPanel.transform, i, "BS_eye.eye_"); | ||||
|     //                    } | ||||
|  | ||||
|     //                    if (HumanBones.ContainsKey(HumanBodyBones.Head) && HumanBones[HumanBodyBones.Head] != null && !EyeTarget) | ||||
|     //                    { | ||||
|     //                        Transform head = HumanBones[HumanBodyBones.Head]; | ||||
|     //                        EyeTarget = (UIHandleEyes)new GameObject().AddComponent<UIHandleEyes>() | ||||
|     //                            .Init(this) | ||||
|     //                            .SetScale(2) | ||||
|     //                            .SetColor(Color.red); | ||||
|     //                        EyeTarget.name = $"Eyes_{ModelId}"; | ||||
|     //                        EyeTarget.transform.localScale = 0.1f * Vector3.one; | ||||
|     //                        EyeTarget.transform.SetParent(head); | ||||
|     //                        EyeTarget.transform.position = head.position + head.forward; | ||||
|     //                    } | ||||
|     //                    goto case "md_eye_special_a"; | ||||
|     //                } | ||||
|     //            case "md_eye_special_a": | ||||
|     //            case "md_eye_special_b": | ||||
|     //                { | ||||
|     //                    go = Instantiate(KF3ModelViewerInterface.EyeTogglePrefab, EyesMorphsPanel.transform); | ||||
|     //                    go.GetChild<Text>().text = child.name; | ||||
|     //                    go.Get<Toggle>().isOn = child.gameObject.activeSelf; | ||||
|     //                    go.Get<Toggle>().onValueChanged.AddListener((value) => { ToggleVisible(child.gameObject, value); }); | ||||
|     //                    InstantiatedObjects.Add(go); | ||||
|     //                    break; | ||||
|     //                } | ||||
|     //            case "md_mouth_base": | ||||
|     //                { | ||||
|     //                    SkinnedMeshRenderer meshRenderer = child.GetComponent<SkinnedMeshRenderer>(); | ||||
|     //                    if (meshRenderer == null) break; | ||||
|     //                    if (meshRenderer.sharedMesh == null) break; | ||||
|     //                    for (int i = 0; i < meshRenderer.sharedMesh.blendShapeCount; i++) | ||||
|     //                    { | ||||
|     //                        CreateMorph(meshRenderer, MouthMorphsPanel.transform, i, "BS_mouth.mouth_"); | ||||
|     //                    } | ||||
|     //                    break; | ||||
|     //                } | ||||
|     //            case "md_eye_l": LeftEye = child; break; | ||||
|     //            case "md_eye_r": RightEye = child; break; | ||||
|     //            case "md_brow_base": | ||||
|     //                { | ||||
|     //                    SkinnedMeshRenderer meshRenderer = child.GetComponent<SkinnedMeshRenderer>(); | ||||
|     //                    if (meshRenderer == null) break; | ||||
|     //                    if (meshRenderer.sharedMesh == null) break; | ||||
|  | ||||
|     //                    for (int i = 0; i < meshRenderer.sharedMesh.blendShapeCount; i++) | ||||
|     //                    { | ||||
|     //                        CreateMorph(meshRenderer, EyebrowsMorphsPanel.transform, i, "BS_brow.brow_"); | ||||
|     //                    } | ||||
|  | ||||
|     //                    break; | ||||
|     //                } | ||||
|     //            case "md_subweapon": | ||||
|     //                { | ||||
|     //                    SubWeapon = child; | ||||
|     //                    if (SubWeaponBone == null) break; | ||||
|     //                    SubWeapon.SetParent(SubWeaponBone); | ||||
|     //                    SubWeapon.SetPositionAndRotation(Vector3.zero, Quaternion.identity); | ||||
|     //                    break; | ||||
|     //                } | ||||
|     //            case "subweapon": | ||||
|     //                { | ||||
|     //                    SubWeaponBone = child; | ||||
|     //                    if (SubWeapon == null) break; | ||||
|     //                    SubWeapon.SetParent(SubWeaponBone); | ||||
|     //                    SubWeapon.SetPositionAndRotation(Vector3.zero, Quaternion.identity); | ||||
|     //                    break; | ||||
|     //                } | ||||
|     //        } | ||||
|     //    } | ||||
|     //} | ||||
|  | ||||
|     public void ResetChildMorphs(Transform self) | ||||
|     { | ||||
|         foreach(var helper in self.GetComponentsInChildren<MorphHelper>()) | ||||
|         { | ||||
|             helper.Slider.value = 0; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     //public void PasteValues(KF3MorphHelper[] helpers) | ||||
|     //{ | ||||
|  | ||||
|     //    foreach (var morph in keyframe.Morphs) | ||||
|     //    { | ||||
|     //        var rend = this.Morphs.Keys.FirstOrDefault(k => k.name == morph.ParentName); | ||||
|     //        if (rend == null) continue; | ||||
|  | ||||
|     //        KF3MorphHelper h = this.Morphs[rend].FirstOrDefault(m => m.Name == morph.Name); | ||||
|     //        if (h != null) this.UpdateMorph(rend, rend.sharedMesh.GetBlendShapeIndex(morph.Name), morph.Strength, h.Slider); | ||||
|     //    } | ||||
|     //} | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3MorphPanel.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3MorphPanel.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: c065bfa1db3360149aed82a772567310 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										65
									
								
								Assets/KF3/Scripts/UI/UIKF3MorphSlider.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								Assets/KF3/Scripts/UI/UIKF3MorphSlider.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,65 @@ | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
| using UnityEngine.UI; | ||||
|  | ||||
| public class UIKF3MorphSlider : MonoBehaviour | ||||
| { | ||||
|     public Slider Slider; | ||||
|     public UICallbacks ToggleCallbacks; | ||||
|     public TMPro.TMP_Text Text; | ||||
|     public Toggle Toggle; | ||||
|  | ||||
|     static KF3ModelViewerInterface UI => KF3ModelViewerInterface.Instance; | ||||
|     static KF3ModelViewerMain Main => KF3ModelViewerMain.Instance; | ||||
|  | ||||
|     public static UIKF3MorphSlider CreateLookAt(KF3FriendContainer container, Transform parent) | ||||
|     { | ||||
|         UIKF3MorphSlider panel = Instantiate(Main.Resources.Pfb_KF3MorphSliderToggle, parent); | ||||
|         panel.Text.text = "Look At Camera"; | ||||
|         panel.Slider.wholeNumbers = false; | ||||
|         panel.Slider.minValue = 0; | ||||
|         panel.Slider.maxValue = 1; | ||||
|         panel.Slider.value = container.LookAtStrength; | ||||
|         panel.Slider.onValueChanged.AddListener((value) => { container.UpdateLookAtTarget(value); container.SetKeyframe(); }); | ||||
|         panel.Toggle.isOn = container.EyesLocked; | ||||
|         panel.Toggle.onValueChanged.AddListener((val) => { container.EyesLocked = val; container.SetKeyframe(); }); | ||||
|         panel.ToggleCallbacks.MouseHover.AddListener(() => | ||||
|         { | ||||
|             panel.ToggleCallbacks.SetTooltipText("Lock current look direction."); | ||||
|         }); | ||||
|         panel.ToggleCallbacks.MouseHoverEnd.AddListener(() => | ||||
|         { | ||||
|             panel.ToggleCallbacks.SetTooltipText(""); | ||||
|         }); | ||||
|         return panel; | ||||
|     } | ||||
|  | ||||
|     public static UIKF3MorphSlider CreateMorph(KF3FriendContainer container, SkinnedMeshRenderer meshRenderer, int index, string nameReplace, Transform parent) | ||||
|     { | ||||
|         UIKF3MorphSlider panel = Instantiate(Main.Resources.Pfb_KF3MorphSlider, parent); | ||||
|          | ||||
|         var helper = new MorphHelper(meshRenderer, meshRenderer.sharedMesh.GetBlendShapeName(index), panel.Slider); | ||||
|         if (container.Morphs.ContainsKey(meshRenderer)) | ||||
|             container.Morphs[meshRenderer].Add(helper); | ||||
|         else | ||||
|             container.Morphs.Add(meshRenderer, new List<MorphHelper>() { helper }); | ||||
|  | ||||
|         panel.Text.text = helper.Name.Replace(nameReplace, ""); | ||||
|         panel.Slider.value = meshRenderer.GetBlendShapeWeight(index); | ||||
|         panel.Slider.onValueChanged.AddListener((value) => { | ||||
|             helper.UpdateMorph(value); | ||||
|             container.SetKeyframe(); | ||||
|         }); | ||||
|         return panel; | ||||
|     } | ||||
|  | ||||
|     public static UIKF3MorphSlider CreateEyeToggle(KF3FriendContainer container, Renderer rend, Transform parent, ToggleGroup group) | ||||
|     { | ||||
|         UIKF3MorphSlider panel = Instantiate(Main.Resources.Pfb_KF3MorphToggle, parent); | ||||
|         panel.Text.text = rend.name; | ||||
|         panel.Toggle.group = group; | ||||
|         panel.Toggle.isOn = rend.gameObject.activeSelf; | ||||
|         panel.Toggle.onValueChanged.AddListener((value) => { container.ToggleVisible(rend.gameObject, value); container.SetKeyframe(); }); | ||||
|         return panel; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3MorphSlider.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3MorphSlider.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: ce70097e989567b4c8cdc841bea38e7c | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										61
									
								
								Assets/KF3/Scripts/UI/UIKF3SceneSettings.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								Assets/KF3/Scripts/UI/UIKF3SceneSettings.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,61 @@ | ||||
| using Newtonsoft.Json.Linq; | ||||
| using System.Linq; | ||||
| using TMPro; | ||||
| using UnityEngine; | ||||
| using UnityEngine.UI; | ||||
|  | ||||
| public class UIKF3SceneSettings : MonoBehaviour | ||||
| { | ||||
|     public KF3SceneContainer Container; | ||||
|     public TMPro.TMP_Dropdown StageDropdown; | ||||
|     public TMPro.TMP_Dropdown BackgroundDropdown; | ||||
|  | ||||
|     public static UIKF3SceneSettings Create(KF3SceneContainer container) | ||||
|     { | ||||
|         var panel = Instantiate(KF3ModelViewerMain.Instance.Resources.Pfb_KF3SceneSettings, KF3ModelViewerInterface.Instance.DynamicPanels); | ||||
|         panel.Container = container; | ||||
|  | ||||
|         foreach (TMP_Dropdown dd in new TMP_Dropdown[] {panel.StageDropdown, panel.BackgroundDropdown}) | ||||
|         { | ||||
|             foreach (Transform t in dd.transform) | ||||
|             { | ||||
|                 if (t.name == "LeftButton") | ||||
|                 { | ||||
|                     t.gameObject.GetComponent<Button>().onClick.AddListener(() => { ModelViewerInterface.DropdownPrevious(dd); }); | ||||
|                 } | ||||
|                 else if (t.name == "RightButton") | ||||
|                 { | ||||
|                     t.gameObject.GetComponent<Button>().onClick.AddListener(() => { ModelViewerInterface.DropdownNext(dd); }); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return panel; | ||||
|     } | ||||
|  | ||||
|     public void OnBackgroundDropdownSelected(int value) | ||||
|     { | ||||
|         if (value == 0) | ||||
|         { | ||||
|             Container.SetBackground(""); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Container.SetBackground(BackgroundDropdown.options[value].text); | ||||
|         } | ||||
|         Container.SetKeyframe(); | ||||
|     } | ||||
|  | ||||
|     public void OnStageDropdownSelected(int value) | ||||
|     { | ||||
|         if (value == 0) | ||||
|         { | ||||
|             Container.SetStage(""); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Container.SetStage(StageDropdown.options[value].text); | ||||
|         } | ||||
|         Container.SetKeyframe(); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3SceneSettings.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3SceneSettings.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 6603c3d220825e143a6b998beb9a503b | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										20
									
								
								Assets/KF3/Scripts/UI/UIKF3StaticSettings.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								Assets/KF3/Scripts/UI/UIKF3StaticSettings.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class UIKF3StaticSettings : MonoBehaviour | ||||
| { | ||||
|     public KF3StaticContainer Container; | ||||
|  | ||||
|     public static UIKF3StaticSettings Create(KF3StaticContainer container) | ||||
|     { | ||||
|         var panel = Instantiate(KF3ModelViewerMain.Instance.Resources.Pfb_KF3StaticSettings, KF3ModelViewerInterface.Instance.DynamicPanels); | ||||
|         panel.Container = container; | ||||
|         return panel; | ||||
|     } | ||||
|      | ||||
|     public void SetMaterialVariant(int index) | ||||
|     { | ||||
|         Container.SetMaterialVariant(index); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3StaticSettings.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/UI/UIKF3StaticSettings.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: c73b775d1cbc65946992a0a659009786 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										178
									
								
								Assets/KF3/Scripts/UpdateChecker.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										178
									
								
								Assets/KF3/Scripts/UpdateChecker.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,178 @@ | ||||
| using System; | ||||
| using System.IO; | ||||
| using System.Net; | ||||
| using System.Text; | ||||
| using System.Linq; | ||||
| using UnityEngine; | ||||
| using Newtonsoft.Json.Linq; | ||||
| using System.IO.Compression; | ||||
| using System.Security.Cryptography; | ||||
| using System.Text.RegularExpressions; | ||||
|  | ||||
| public class UpdateChecker : MonoBehaviour | ||||
| { | ||||
|     public void RequestUpdate() | ||||
|     { | ||||
|         var version = Settings.GameVersion; | ||||
|         var bundleUrl = ""; | ||||
|  | ||||
|         try { version = GetAndroidVersion(); } | ||||
|         catch { Error.Log(Color.red, $"Failed getting game version. Using {version} from settings"); } | ||||
|  | ||||
|         if(version != Settings.GameVersion) | ||||
|         { | ||||
|             Settings.Instance.gameVersion = version; | ||||
|             Settings.Save(); | ||||
|         } | ||||
|  | ||||
|         try { bundleUrl = GetAssetbundleUrl(version); } | ||||
|         catch { Error.Log(Color.red, $"Failed getting assets url"); return; } | ||||
|  | ||||
|         if(bundleUrl != Settings.AssetsUrl) | ||||
|         { | ||||
|             if(UpdateUrlFile(bundleUrl)) | ||||
|                 Error.Log(Color.green, "Update Successful! Please restart the viewer to download new files."); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Error.Log(Color.green, "You already have the newest files!"); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public string GetAndroidVersion() | ||||
|     { | ||||
|         string url = "https://play.google.com/store/apps/details?id=com.sega.KemonoFriends3"; | ||||
|  | ||||
|         HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(url); | ||||
|         using (HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse()) | ||||
|         using (Stream stream = httpResponse.GetResponseStream()) | ||||
|         using (StreamReader stringReader = new StreamReader(stream)) | ||||
|         { | ||||
|             var response = stringReader.ReadToEnd(); | ||||
|             var result = Regex.Match(response, @"""\b(\d+\.\d+\.\d+)\b"""); | ||||
|             return result.Groups[1].Value; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public string GetAssetbundleUrl(string version) | ||||
|     { | ||||
|         string param = Encode($"{{'version':'{version}','dmm_viewer_id':0,'platform':1}}".Replace("'", "\"")); | ||||
|         Debug.Log(param); | ||||
|  | ||||
|         HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create("https://parade-mobile-prod-app.kemono-friends-3.jp/paradesv/common/GetUrl.do?param=" + param); | ||||
|         httpRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0"; | ||||
|         httpRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; | ||||
|  | ||||
|         using (HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse()) | ||||
|         using (Stream stream = httpResponse.GetResponseStream()) | ||||
|         using (Stream decompress = new GZipStream(stream, CompressionMode.Decompress)) | ||||
|         using (StreamReader stringReader = new StreamReader(decompress)) | ||||
|         { | ||||
|             var response = stringReader.ReadToEnd(); | ||||
|             var json = JObject.Parse(response); | ||||
|             return json["asset_bundle_url"].ToString(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private bool UpdateUrlFile(string newVersion) | ||||
|     { | ||||
|         try | ||||
|         { | ||||
|             if (File.Exists(Path.Combine(Settings.AssetListDirectory, "ab_list.txt"))) | ||||
|             { | ||||
|                 File.Delete(Path.Combine(Settings.AssetListDirectory, "ab_list.txt")); | ||||
|             } | ||||
|             Settings.Instance.assetsUrl = newVersion; | ||||
|             Settings.Save(); | ||||
|             return true; | ||||
|         } | ||||
|         catch (Exception e) | ||||
|         { | ||||
|             Debug.LogError(e.Message); | ||||
|             return false; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public string Encode(string request) | ||||
|     { | ||||
|         MD5 md5 = MD5.Create(); | ||||
|  | ||||
|         string hashed = GetMd5Hash(md5, request); | ||||
|         string checksum = GetMd5Hash(md5, request + "DARAPAB "); | ||||
|         string key = BytesToHexString(md5.ComputeHash(HexStringToByteArray(hashed.Substring(0, 8)))); | ||||
|  | ||||
|         //xor with the key | ||||
|         byte[] requestBytes = Encoding.ASCII.GetBytes(request); | ||||
|         byte[] keyBytes = HexStringToByteArray(key); | ||||
|  | ||||
|         for (int i = 0; i < requestBytes.Length; i++) | ||||
|         { | ||||
|             requestBytes[i] ^= keyBytes[i % keyBytes.Length]; | ||||
|         } | ||||
|  | ||||
|         request = (hashed.Substring(0, 8) + BytesToHexString(requestBytes) + checksum); | ||||
|  | ||||
|         return request; | ||||
|     } | ||||
|  | ||||
|     public string Decode(string request) | ||||
|     { | ||||
|         MD5 md5 = MD5.Create(); | ||||
|  | ||||
|         string key = BytesToHexString(md5.ComputeHash(HexStringToByteArray(request.Substring(0, 8)))); | ||||
|         string hash = request.Substring(8, request.Length - 40); | ||||
|  | ||||
|         byte[] requestBytes = HexStringToByteArray(hash); | ||||
|         byte[] keyBytes = HexStringToByteArray(key); | ||||
|  | ||||
|         for (int i = 0; i < requestBytes.Length; i++) | ||||
|         { | ||||
|             requestBytes[i] ^= keyBytes[i % keyBytes.Length]; | ||||
|         } | ||||
|  | ||||
|         return Encoding.UTF8.GetString(requestBytes); | ||||
|     } | ||||
|  | ||||
|     public string GetMd5Hash(MD5 md5Hash, string input) | ||||
|     { | ||||
|         // Convert the input string to a byte array and compute the hash. | ||||
|         byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input)); | ||||
|  | ||||
|         // Create a new Stringbuilder to collect the bytes | ||||
|         // and create a string. | ||||
|         StringBuilder sBuilder = new StringBuilder(); | ||||
|  | ||||
|         // Loop through each byte of the hashed data | ||||
|         // and format each one as a hexadecimal string. | ||||
|         for (int i = 0; i < data.Length; i++) | ||||
|         { | ||||
|             sBuilder.Append(data[i].ToString("x2")); | ||||
|         } | ||||
|  | ||||
|         // Return the hexadecimal string. | ||||
|         return sBuilder.ToString(); | ||||
|     } | ||||
|  | ||||
|     public byte[] HexStringToByteArray(string hex) | ||||
|     { | ||||
|         return Enumerable.Range(0, hex.Length) | ||||
|                          .Where(x => x % 2 == 0) | ||||
|                          .Select(x => Convert.ToByte(hex.Substring(x, 2), 16)) | ||||
|                          .ToArray(); | ||||
|     } | ||||
|  | ||||
|     public string BytesToHexString(byte[] data) | ||||
|     { | ||||
|         StringBuilder sBuilder = new StringBuilder(); | ||||
|  | ||||
|         // Loop through each byte of the hashed data | ||||
|         // and format each one as a hexadecimal string. | ||||
|         for (int i = 0; i < data.Length; i++) | ||||
|         { | ||||
|             sBuilder.Append(data[i].ToString("x2")); | ||||
|         } | ||||
|  | ||||
|         // Return the hexadecimal string. | ||||
|         return sBuilder.ToString(); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								Assets/KF3/Scripts/UpdateChecker.cs.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Assets/KF3/Scripts/UpdateChecker.cs.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: e4fd907043146404ca0b7f46f1920164 | ||||
| MonoImporter: | ||||
|   externalObjects: {} | ||||
|   serializedVersion: 2 | ||||
|   defaultReferences: [] | ||||
|   executionOrder: 0 | ||||
|   icon: {instanceID: 0} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										8
									
								
								Assets/KF3/Shader.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Assets/KF3/Shader.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 001daf784f9d05a438e88dd1eeb56ed1 | ||||
| folderAsset: yes | ||||
| DefaultImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										86
									
								
								Assets/KF3/Shader/Depth.mat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								Assets/KF3/Shader/Depth.mat
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,86 @@ | ||||
| %YAML 1.1 | ||||
| %TAG !u! tag:unity3d.com,2011: | ||||
| --- !u!21 &2100000 | ||||
| Material: | ||||
|   serializedVersion: 6 | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_Name: Depth | ||||
|   m_Shader: {fileID: 4800000, guid: 781d003a4921452409fd6f42a135a013, type: 3} | ||||
|   m_ShaderKeywords:  | ||||
|   m_LightmapFlags: 4 | ||||
|   m_EnableInstancingVariants: 0 | ||||
|   m_DoubleSidedGI: 0 | ||||
|   m_CustomRenderQueue: -1 | ||||
|   stringTagMap: {} | ||||
|   disabledShaderPasses: [] | ||||
|   m_SavedProperties: | ||||
|     serializedVersion: 3 | ||||
|     m_TexEnvs: | ||||
|     - _BumpMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _DetailAlbedoMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _DetailMask: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _DetailNormalMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _EmissionMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _MainTex: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _MetallicGlossMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _OcclusionMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _ParallaxMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _texcoord: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     m_Floats: | ||||
|     - _BumpScale: 1 | ||||
|     - _Cutoff: 0.5 | ||||
|     - _DetailNormalMapScale: 1 | ||||
|     - _DstBlend: 0 | ||||
|     - _GlossMapScale: 1 | ||||
|     - _Glossiness: 0.5 | ||||
|     - _GlossyReflections: 1 | ||||
|     - _Length: 5.89 | ||||
|     - _Metallic: 0 | ||||
|     - _Mode: 0 | ||||
|     - _OcclusionStrength: 1 | ||||
|     - _Offset: -1.27 | ||||
|     - _Outline_Width: 0 | ||||
|     - _Parallax: 0.02 | ||||
|     - _SmoothnessTextureChannel: 0 | ||||
|     - _SpecularHighlights: 1 | ||||
|     - _SrcBlend: 1 | ||||
|     - _UVSec: 0 | ||||
|     - _ZWrite: 1 | ||||
|     - __dirty: 0 | ||||
|     m_Colors: | ||||
|     - _Color: {r: 1, g: 1, b: 1, a: 1} | ||||
|     - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} | ||||
|   m_BuildTextureStacks: [] | ||||
							
								
								
									
										8
									
								
								Assets/KF3/Shader/Depth.mat.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Assets/KF3/Shader/Depth.mat.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: bedc6325a0d79c74d993303908f4a896 | ||||
| NativeFormatImporter: | ||||
|   externalObjects: {} | ||||
|   mainObjectFileID: 0 | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										82
									
								
								Assets/KF3/Shader/DepthShader.shader
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								Assets/KF3/Shader/DepthShader.shader
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,82 @@ | ||||
| // Made with Amplify Shader Editor | ||||
| // Available at the Unity Asset Store - http://u3d.as/y3X  | ||||
| Shader "DepthShader" | ||||
| { | ||||
| 	Properties | ||||
| 	{ | ||||
| 		_Cutoff( "Mask Clip Value", Float ) = 0.5 | ||||
| 		_Outline_Width("Outline_Width", Float) = 0 | ||||
| 		_MainTex("MainTex", 2D) = "white" {} | ||||
| 		[HideInInspector] _texcoord( "", 2D ) = "white" {} | ||||
| 		[HideInInspector] __dirty( "", Int ) = 1 | ||||
| 	} | ||||
|  | ||||
| 	SubShader | ||||
| 	{ | ||||
| 		Tags{ "RenderType" = "Opaque"  "Queue" = "AlphaTest+0" "IgnoreProjector" = "True" "IsEmissive" = "true"  } | ||||
| 		Cull Back | ||||
| 		CGPROGRAM | ||||
| 		#include "UnityShaderVariables.cginc" | ||||
| 		#pragma target 3.0 | ||||
| 		#pragma surface surf Standard keepalpha noshadow vertex:vertexDataFunc  | ||||
| 		struct Input | ||||
| 		{ | ||||
| 			float eyeDepth; | ||||
| 			float2 uv_texcoord; | ||||
| 		}; | ||||
|  | ||||
| 		uniform float _Outline_Width; | ||||
| 		uniform float Length; | ||||
| 		uniform float Offset; | ||||
| 		uniform sampler2D _MainTex; | ||||
| 		SamplerState sampler_MainTex; | ||||
| 		uniform float4 _MainTex_ST; | ||||
| 		uniform float _Cutoff = 0.5; | ||||
|  | ||||
| 		void vertexDataFunc( inout appdata_full v, out Input o ) | ||||
| 		{ | ||||
| 			UNITY_INITIALIZE_OUTPUT( Input, o ); | ||||
| 			float3 ase_vertexNormal = v.normal.xyz; | ||||
| 			v.vertex.xyz += ( ase_vertexNormal * ( _Outline_Width * 0.001 ) ); | ||||
| 			v.vertex.w = 1; | ||||
| 			o.eyeDepth = -UnityObjectToViewPos( v.vertex.xyz ).z; | ||||
| 		} | ||||
|  | ||||
| 		void surf( Input i , inout SurfaceOutputStandard o ) | ||||
| 		{ | ||||
| 			float cameraDepthFade1 = (( i.eyeDepth -_ProjectionParams.y - Offset ) / Length); | ||||
| 			float3 temp_cast_0 = (cameraDepthFade1).xxx; | ||||
| 			o.Emission = temp_cast_0; | ||||
| 			o.Alpha = 1; | ||||
| 			float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw; | ||||
| 			clip( tex2D( _MainTex, uv_MainTex ).a - _Cutoff ); | ||||
| 		} | ||||
|  | ||||
| 		ENDCG | ||||
| 	} | ||||
| 	CustomEditor "ASEMaterialInspector" | ||||
| } | ||||
| /*ASEBEGIN | ||||
| Version=18500 | ||||
| 287;309;1382;648;779.9207;284.6495;1.046712;True;False | ||||
| Node;AmplifyShaderEditor.RangedFloatNode;8;-347.5857,445.3018;Inherit;False;Property;_Outline_Width;Outline_Width;1;0;Create;True;0;0;False;0;False;0;1;0;0;0;1;FLOAT;0 | ||||
| Node;AmplifyShaderEditor.RangedFloatNode;5;-743.1245,-136.5234;Inherit;False;Global;Length;Length;0;0;Create;True;0;0;False;0;False;5;35;0;0;0;1;FLOAT;0 | ||||
| Node;AmplifyShaderEditor.RangedFloatNode;6;-749.1449,-49.33564;Inherit;False;Global;Offset;Offset;1;0;Create;True;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0 | ||||
| Node;AmplifyShaderEditor.NormalVertexDataNode;9;-344.5857,255.3022;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 | ||||
| Node;AmplifyShaderEditor.ScaleNode;10;-148.3429,440.3138;Inherit;False;0.001;1;0;FLOAT;0;False;1;FLOAT;0 | ||||
| Node;AmplifyShaderEditor.CameraDepthFade;1;-525.7656,-123.8789;Inherit;False;3;2;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0;False;1;FLOAT;0 | ||||
| Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;-49.58564,304.3021;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0 | ||||
| Node;AmplifyShaderEditor.SamplerNode;12;-345.4782,-1.867204;Inherit;True;Property;_MainTex;MainTex;2;0;Create;True;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 | ||||
| Node;AmplifyShaderEditor.OneMinusNode;4;-213.0137,-175.1542;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 | ||||
| Node;AmplifyShaderEditor.StandardSurfaceOutputNode;15;229.2125,14.16482;Float;False;True;-1;2;ASEMaterialInspector;0;0;Standard;DepthShader;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Custom;0.5;True;False;0;True;Opaque;;AlphaTest;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;False;0;5;False;-1;10;False;-1;0;1;False;-1;1;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;0;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;False;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0 | ||||
| WireConnection;10;0;8;0 | ||||
| WireConnection;1;0;5;0 | ||||
| WireConnection;1;1;6;0 | ||||
| WireConnection;11;0;9;0 | ||||
| WireConnection;11;1;10;0 | ||||
| WireConnection;4;0;1;0 | ||||
| WireConnection;15;2;1;0 | ||||
| WireConnection;15;10;12;4 | ||||
| WireConnection;15;11;11;0 | ||||
| ASEEND*/ | ||||
| //CHKSM=6B241380E5AA10943B14A993E72468FA220D6D4E | ||||
							
								
								
									
										10
									
								
								Assets/KF3/Shader/DepthShader.shader.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								Assets/KF3/Shader/DepthShader.shader.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| fileFormatVersion: 2 | ||||
| guid: 781d003a4921452409fd6f42a135a013 | ||||
| ShaderImporter: | ||||
|   externalObjects: {} | ||||
|   defaultTextures: [] | ||||
|   nonModifiableTextures: [] | ||||
|   preprocessorOverride: 0 | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
							
								
								
									
										82
									
								
								Assets/KF3/Shader/KemonoAlpha.mat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								Assets/KF3/Shader/KemonoAlpha.mat
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,82 @@ | ||||
| %YAML 1.1 | ||||
| %TAG !u! tag:unity3d.com,2011: | ||||
| --- !u!21 &2100000 | ||||
| Material: | ||||
|   serializedVersion: 6 | ||||
|   m_ObjectHideFlags: 0 | ||||
|   m_CorrespondingSourceObject: {fileID: 0} | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_Name: KemonoAlpha | ||||
|   m_Shader: {fileID: 4800000, guid: 655ab0f80cef02c4eb96d201530ab0dd, type: 3} | ||||
|   m_ShaderKeywords:  | ||||
|   m_LightmapFlags: 0 | ||||
|   m_EnableInstancingVariants: 0 | ||||
|   m_DoubleSidedGI: 0 | ||||
|   m_CustomRenderQueue: -1 | ||||
|   stringTagMap: {} | ||||
|   disabledShaderPasses: [] | ||||
|   m_SavedProperties: | ||||
|     serializedVersion: 3 | ||||
|     m_TexEnvs: | ||||
|     - _BumpMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _DetailAlbedoMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _DetailMask: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _DetailNormalMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _EmissionMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _MainTex: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _MetallicGlossMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _OcclusionMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     - _ParallaxMap: | ||||
|         m_Texture: {fileID: 0} | ||||
|         m_Scale: {x: 1, y: 1} | ||||
|         m_Offset: {x: 0, y: 0} | ||||
|     m_Floats: | ||||
|     - _BumpScale: 1 | ||||
|     - _Cutoff: 0.5 | ||||
|     - _DetailNormalMapScale: 1 | ||||
|     - _DstBlend: 0 | ||||
|     - _GlossMapScale: 1 | ||||
|     - _Glossiness: 0.5 | ||||
|     - _GlossyReflections: 1 | ||||
|     - _Metallic: 0 | ||||
|     - _Mode: 0 | ||||
|     - _OcclusionStrength: 1 | ||||
|     - _Outline_Width: 0 | ||||
|     - _Parallax: 0.02 | ||||
|     - _SmoothnessTextureChannel: 0 | ||||
|     - _SpecularHighlights: 1 | ||||
|     - _SrcBlend: 1 | ||||
|     - _UVSec: 0 | ||||
|     - _Width: 0.01 | ||||
|     - _ZWrite: 1 | ||||
|     - __dirty: 0 | ||||
|     m_Colors: | ||||
|     - _Color: {r: 1, g: 1, b: 1, a: 1} | ||||
|     - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} | ||||
|     - _OutlineColor: {r: 1, g: 1, b: 1, a: 0} | ||||
|   m_BuildTextureStacks: [] | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user