diff --git a/.vsconfig b/.vsconfig new file mode 100644 index 00000000..f019fd0a --- /dev/null +++ b/.vsconfig @@ -0,0 +1,6 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Workload.ManagedGame" + ] +} diff --git a/Assets/OctoCore.meta b/Assets/OctoCore.meta new file mode 100644 index 00000000..035f0214 --- /dev/null +++ b/Assets/OctoCore.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3a9e4552285fa3744ab8bb338f4cd546 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OctoCore/Data.meta b/Assets/OctoCore/Data.meta new file mode 100644 index 00000000..783f2173 --- /dev/null +++ b/Assets/OctoCore/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f97afdd7824eac847a26da67bc33ae4f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OctoCore/Data/settings.asset b/Assets/OctoCore/Data/settings.asset new file mode 100644 index 00000000..c9955810 --- /dev/null +++ b/Assets/OctoCore/Data/settings.asset @@ -0,0 +1,175 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c12f834718fa7c2479f8a954db0682ec, type: 3} + m_Name: settings + m_EditorClassIdentifier: + Save: + Booleans: + - {fileID: 11400000, guid: 9db22356e41f3ef4eb214c98f0d309c3, type: 2} + Integers: [] + Floats: [] + Strings: + - {fileID: 11400000, guid: a186262be747dae448e59cbe43ebe286, type: 2} + - {fileID: 11400000, guid: 70ce020f0ed1ad24a94c854da5d6538e, type: 2} + Vectors: [] + Mapping: + InputActionAsset: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Actions: + - Name: Move + MapName: Player + Action: -560403583 + Reference: {fileID: -1680190386980627800, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Look + MapName: Player + Action: -916633937 + Reference: {fileID: -5630151704836100654, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Attack + MapName: Player + Action: -350647692 + Reference: {fileID: 1120369429361536294, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Interact + MapName: Player + Action: -2066596810 + Reference: {fileID: 1781555164194001046, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Crouch + MapName: Player + Action: 510396034 + Reference: {fileID: 7040659881675835329, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Jump + MapName: Player + Action: -1877919292 + Reference: {fileID: -2099379676528639254, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Previous + MapName: Player + Action: -1566477299 + Reference: {fileID: 2411907206095950430, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Next + MapName: Player + Action: -1266215613 + Reference: {fileID: 7476244043514120974, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Sprint + MapName: Player + Action: 1115268836 + Reference: {fileID: -7471211009204490832, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Navigate + MapName: UI + Action: -1768796602 + Reference: {fileID: -8784545083839296357, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Submit + MapName: UI + Action: -1966140153 + Reference: {fileID: 392368643174621059, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Cancel + MapName: UI + Action: 728645621 + Reference: {fileID: 7727032971491509709, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Point + MapName: UI + Action: 1869126131 + Reference: {fileID: -1654692200621890270, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Click + MapName: UI + Action: -468029055 + Reference: {fileID: 3001919216989983466, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: RightClick + MapName: UI + Action: -1344942599 + Reference: {fileID: -4090225696740746782, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: MiddleClick + MapName: UI + Action: 1604886768 + Reference: {fileID: -2185481485913320682, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: ScrollWheel + MapName: UI + Action: 207319517 + Reference: {fileID: 6240969308177333660, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: TrackedDevicePosition + MapName: UI + Action: 1110904968 + Reference: {fileID: 6564999863303420839, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: TrackedDeviceOrientation + MapName: UI + Action: 1632432327 + Reference: {fileID: 7970375526676320489, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + Languages: + Default: 1 + SaveWritten: {fileID: 11400000, guid: 32dca1ce9df9b064b8a0a2b3ab0fd8dd, type: 2} + SaveAudio: {fileID: 11400000, guid: 225ffb773e59f8141bacbba2a9ede731, type: 2} + Overrides: [] + Scenes: + SceneDatas: [] + UseAddressables: 0 + FadeSettings: + FadeInDuration: 0.5 + FadeOutDuration: 0.5 + FadeColor: {r: 0, g: 0, b: 0, a: 1} + Ui: + ReferenceSize: {x: 1440, y: 3120} + IconsBackground: + DefaultButton: {fileID: 0} diff --git a/Assets/OctoCore/Data/settings.asset.meta b/Assets/OctoCore/Data/settings.asset.meta new file mode 100644 index 00000000..fee4a88f --- /dev/null +++ b/Assets/OctoCore/Data/settings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9341bb9f336f4244db5e26afbe143ec6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OctoCore/Editor.meta b/Assets/OctoCore/Editor.meta new file mode 100644 index 00000000..37848655 --- /dev/null +++ b/Assets/OctoCore/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 434339f294ddfb84da4645dd299e50f5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OctoCore/Editor/OctoActions.json b/Assets/OctoCore/Editor/OctoActions.json new file mode 100644 index 00000000..37172f52 --- /dev/null +++ b/Assets/OctoCore/Editor/OctoActions.json @@ -0,0 +1,132 @@ +{ + "GeneratedFrom": "PlayerController", + "GeneratedOn": "2026-02-09 21:55:05", + "Actions": [ + { + "Name": "Player_Move", + "Hash": -560403583, + "MapName": "Player", + "ActionName": "Move" + }, + { + "Name": "Player_Look", + "Hash": -916633937, + "MapName": "Player", + "ActionName": "Look" + }, + { + "Name": "Player_Attack", + "Hash": -350647692, + "MapName": "Player", + "ActionName": "Attack" + }, + { + "Name": "Player_Interact", + "Hash": -2066596810, + "MapName": "Player", + "ActionName": "Interact" + }, + { + "Name": "Player_Crouch", + "Hash": 510396034, + "MapName": "Player", + "ActionName": "Crouch" + }, + { + "Name": "Player_Jump", + "Hash": -1877919292, + "MapName": "Player", + "ActionName": "Jump" + }, + { + "Name": "Player_Previous", + "Hash": -1566477299, + "MapName": "Player", + "ActionName": "Previous" + }, + { + "Name": "Player_Next", + "Hash": -1266215613, + "MapName": "Player", + "ActionName": "Next" + }, + { + "Name": "Player_Sprint", + "Hash": 1115268836, + "MapName": "Player", + "ActionName": "Sprint" + }, + { + "Name": "Player_Diapason", + "Hash": -1931519977, + "MapName": "Player", + "ActionName": "Diapason" + }, + { + "Name": "Player_Fire", + "Hash": 380421744, + "MapName": "Player", + "ActionName": "Fire" + }, + { + "Name": "UI_Navigate", + "Hash": -1768796602, + "MapName": "UI", + "ActionName": "Navigate" + }, + { + "Name": "UI_Submit", + "Hash": -1966140153, + "MapName": "UI", + "ActionName": "Submit" + }, + { + "Name": "UI_Cancel", + "Hash": 728645621, + "MapName": "UI", + "ActionName": "Cancel" + }, + { + "Name": "UI_Point", + "Hash": 1869126131, + "MapName": "UI", + "ActionName": "Point" + }, + { + "Name": "UI_Click", + "Hash": -468029055, + "MapName": "UI", + "ActionName": "Click" + }, + { + "Name": "UI_RightClick", + "Hash": -1344942599, + "MapName": "UI", + "ActionName": "RightClick" + }, + { + "Name": "UI_MiddleClick", + "Hash": 1604886768, + "MapName": "UI", + "ActionName": "MiddleClick" + }, + { + "Name": "UI_ScrollWheel", + "Hash": 207319517, + "MapName": "UI", + "ActionName": "ScrollWheel" + }, + { + "Name": "UI_TrackedDevicePosition", + "Hash": 1110904968, + "MapName": "UI", + "ActionName": "TrackedDevicePosition" + }, + { + "Name": "UI_TrackedDeviceOrientation", + "Hash": 1632432327, + "MapName": "UI", + "ActionName": "TrackedDeviceOrientation" + } + ] +} \ No newline at end of file diff --git a/Assets/OctoCore/Editor/OctoActions.json.meta b/Assets/OctoCore/Editor/OctoActions.json.meta new file mode 100644 index 00000000..e8e7fce1 --- /dev/null +++ b/Assets/OctoCore/Editor/OctoActions.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5fe7d0a695b6514439b9ebb525e66a0f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OctoCore/Prefabs.meta b/Assets/OctoCore/Prefabs.meta new file mode 100644 index 00000000..d0456793 --- /dev/null +++ b/Assets/OctoCore/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70f67389b1a2bed48a355cfb0763e86d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OctoCore/Prefabs/OctoCore.prefab b/Assets/OctoCore/Prefabs/OctoCore.prefab new file mode 100644 index 00000000..7b43ca0e --- /dev/null +++ b/Assets/OctoCore/Prefabs/OctoCore.prefab @@ -0,0 +1,69 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &8589544845245727413 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6194350059673118374} + - component: {fileID: 4562949134636194362} + m_Layer: 0 + m_Name: OctoCore + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6194350059673118374 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8589544845245727413} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4562949134636194362 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8589544845245727413} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a699f971e869ebf46915f66af5dc8102, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OctoCore.OctoCore + Settings: {fileID: 11400000, guid: 9341bb9f336f4244db5e26afbe143ec6, type: 2} + _platform: + _current: 0 + _controller: 0 + _save: + Booleans: [] + Integers: [] + Floats: [] + Strings: [] + Vectors: [] + _inputs: + Actions: [] + _localization: + WrittenLanguage: 0 + AudioLanguage: 0 + _ui: + GlobalScale: 1 + ScreenSize: {x: 0, y: 0} + _navigation: + CurrentScene: {fileID: 0} + PendingTeleporter: {fileID: 0} + _development: + Log: 0 diff --git a/Assets/OctoCore/Prefabs/OctoCore.prefab.meta b/Assets/OctoCore/Prefabs/OctoCore.prefab.meta new file mode 100644 index 00000000..0b8d7d28 --- /dev/null +++ b/Assets/OctoCore/Prefabs/OctoCore.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 96643caadeda8ad4295e3f293f527994 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OctoCore/Prefabs/OctoEvents.prefab b/Assets/OctoCore/Prefabs/OctoEvents.prefab new file mode 100644 index 00000000..549ca2b3 --- /dev/null +++ b/Assets/OctoCore/Prefabs/OctoEvents.prefab @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4347882179124040567 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 136799558801349280} + - component: {fileID: 6424964998645044441} + m_Layer: 0 + m_Name: OctoEvents + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &136799558801349280 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4347882179124040567} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6424964998645044441 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4347882179124040567} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 86cab3031ee84484985b55a4e37af012, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OctoCoreEvents + _onPlatformInitialized: + m_PersistentCalls: + m_Calls: [] + _onSaveInitialized: + m_PersistentCalls: + m_Calls: [] + _onInputsInitialized: + m_PersistentCalls: + m_Calls: [] + _onLocalizationInitialized: + m_PersistentCalls: + m_Calls: [] + _onScenesInitialized: + m_PersistentCalls: + m_Calls: [] + _onUiInitialized: + m_PersistentCalls: + m_Calls: [] + _onOctoCoreInitialized: + m_PersistentCalls: + m_Calls: [] diff --git a/Assets/OctoCore/Prefabs/OctoEvents.prefab.meta b/Assets/OctoCore/Prefabs/OctoEvents.prefab.meta new file mode 100644 index 00000000..de334a3f --- /dev/null +++ b/Assets/OctoCore/Prefabs/OctoEvents.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f8645ecc23a530441a2ef474d90afcec +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OctoCore/Prefabs/OctoLink.prefab b/Assets/OctoCore/Prefabs/OctoLink.prefab new file mode 100644 index 00000000..ef95770d --- /dev/null +++ b/Assets/OctoCore/Prefabs/OctoLink.prefab @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3352382525843710285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2854166076162324619} + - component: {fileID: 417140402366356801} + m_Layer: 0 + m_Name: OctoLink + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2854166076162324619 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3352382525843710285} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &417140402366356801 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3352382525843710285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aca1ddad5b073a9488d37617a5fd8d9a, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OctoLink + _octoCore: {fileID: 8589544845245727413, guid: 96643caadeda8ad4295e3f293f527994, type: 3} diff --git a/Assets/OctoCore/Prefabs/OctoLink.prefab.meta b/Assets/OctoCore/Prefabs/OctoLink.prefab.meta new file mode 100644 index 00000000..946df4fc --- /dev/null +++ b/Assets/OctoCore/Prefabs/OctoLink.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5b26c779fcba62a49931d3f615653767 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OctoCore/Prefabs/OctoPlayerFP.prefab b/Assets/OctoCore/Prefabs/OctoPlayerFP.prefab new file mode 100644 index 00000000..a0a52840 --- /dev/null +++ b/Assets/OctoCore/Prefabs/OctoPlayerFP.prefab @@ -0,0 +1,494 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2101508725665932610 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1836339402272228918} + - component: {fileID: 3666612565151794712} + - component: {fileID: 6053283114444666027} + - component: {fileID: 6989128982853398086} + m_Layer: 0 + m_Name: Camera Player + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1836339402272228918 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2101508725665932610} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.562, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8725966219179855439} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &3666612565151794712 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2101508725665932610} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.1 + far clip plane: 1000 + field of view: 80 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &6053283114444666027 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2101508725665932610} + m_Enabled: 1 +--- !u!114 &6989128982853398086 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2101508725665932610} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalCameraData + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!1 &8162540767767967414 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8725966219179855439} + - component: {fileID: 1735456339091181674} + - component: {fileID: 5295567073180248356} + m_Layer: 0 + m_Name: OctoPlayerFP + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8725966219179855439 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8162540767767967414} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1836339402272228918} + - {fileID: 2639365499984405449} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!143 &1735456339091181674 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8162540767767967414} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Height: 1.8 + m_Radius: 0.3 + m_SlopeLimit: 45 + m_StepOffset: 0.3 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0.001 + m_Center: {x: 0, y: 0.94, z: 0} +--- !u!114 &5295567073180248356 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8162540767767967414} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c85c0434d95406f4da8daa149ba90838, type: 3} + m_Name: + m_EditorClassIdentifier: OctoCore.Runtime::OctoCore.Components.OctoPlayer + _references: + Controller: {fileID: 1735456339091181674} + _settings: + Mode: 0 + Orientation: 1 + WalkSpeed: 10 + RunSpeed: 20 + JumpDuration: 0.4 + JumpHeight: 0.4 + Gravity: 9.8 + _mapping: + MoveAction: -560403583 + LookAction: -916633937 + RunAction: 1115268836 + JumpAction: -1877919292 + _firstPerson: + Camera: {fileID: 3666612565151794712} + SensitivityX: 0.1 + SensitivityY: 0.1 + MinPitch: -80 + MaxPitch: 80 +--- !u!1001 &2564566619627430770 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8725966219179855439} + m_Modifications: + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 899615586671794689, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_Name + value: Arms + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.x + value: 0.1 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.y + value: -0.2685 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.z + value: 0.2737 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: -0.3780753 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.44424582 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: -0.5555247 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0.5925345 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 161.191 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -89.278015 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 84.124 + objectReference: {fileID: 0} + - target: {fileID: 2656140929319940858, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 2656140929319940858, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: -0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 2656140929319940858, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10 + objectReference: {fileID: 0} + - target: {fileID: 2736084570026017097, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 2736084570026017097, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 2736084570026017097, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.35385045 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.112266205 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.058453187 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0.92669815 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.655 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.451 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 137.992 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.11226625 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: -0.35385033 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.92669827 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: -0.05845286 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.655 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 165.549 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -42.008 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.x + value: -0.1 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.y + value: -0.2685 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.z + value: 0.2737 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.44424608 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.37807533 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.59253436 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0.5555246 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 198.809 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -90.721985 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -95.87601 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9622502 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.084186025 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.25783423 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: -0.02255758 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9622502 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.084186025 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: -0.25783414 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0.022557573 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -30 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} +--- !u!4 &2639365499984405449 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + m_PrefabInstance: {fileID: 2564566619627430770} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/OctoCore/Prefabs/OctoPlayerFP.prefab.meta b/Assets/OctoCore/Prefabs/OctoPlayerFP.prefab.meta new file mode 100644 index 00000000..b0f47062 --- /dev/null +++ b/Assets/OctoCore/Prefabs/OctoPlayerFP.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 524ca0dabcf93844ea5f981410f44310 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Editor.meta b/Packages/OctoCore/Editor.meta new file mode 100644 index 00000000..c80e9383 --- /dev/null +++ b/Packages/OctoCore/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e851edaaa3c416e48a03232754e26760 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Editor/OctoActionsPostImport.cs b/Packages/OctoCore/Editor/OctoActionsPostImport.cs new file mode 100644 index 00000000..9af53ca1 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoActionsPostImport.cs @@ -0,0 +1,274 @@ +using UnityEngine; + +#if UNITY_EDITOR +using UnityEditor; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Linq; + +namespace OctoCore.Inputs +{ + /// + /// Automatically restores OctoActions.cs from backup JSON when package is updated. + /// + [InitializeOnLoad] + public class OctoActionsPostImport + { + private const string BACKUP_FILE = "Assets/OctoCore/Editor/OctoActions.json"; + + private static string GetActionsFilePath() + { + // Find OctoInputs.cs to locate the package + string[] guids = AssetDatabase.FindAssets("OctoInputs t:script"); + foreach (string guid in guids) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + if (path.Contains("/Inputs/OctoInputs.cs")) + { + // Found it! Same directory + string directory = Path.GetDirectoryName(path); + return Path.Combine(directory, "OctoActions.cs").Replace("\\", "/"); + } + } + + // Fallback + return "Assets/OctoCore/Generated/OctoActions.cs"; + } + + static OctoActionsPostImport() + { + // Restore from backup if needed + EditorApplication.delayCall += RestoreFromBackup; + } + + [MenuItem("OctoCore/Input Actions/Restore from Backup")] + public static void ForceRestore() + { + RestoreFromBackup(); + } + + [MenuItem("OctoCore/Input Actions/Reset to Template")] + public static void ResetToTemplate() + { + if (!EditorUtility.DisplayDialog( + "Reset OctoActions", + "This will reset OctoActions.cs to the template (None = 0).\n\n" + + "The backup JSON will be kept, so you can restore later.\n\n" + + "Are you sure?", + "Reset", + "Cancel")) + { + return; + } + + string actionsFile = GetActionsFilePath(); + CreateTemplate(actionsFile); + AssetDatabase.Refresh(); + + Debug.Log("[OctoCore] OctoActions.cs reset to template."); + } + + [MenuItem("OctoCore/Input Actions/Delete Backup")] + public static void DeleteBackup() + { + if (!File.Exists(BACKUP_FILE)) + { + EditorUtility.DisplayDialog("No Backup", "No backup file found.", "OK"); + return; + } + + if (!EditorUtility.DisplayDialog( + "Delete Backup", + "This will permanently delete the backup JSON.\n\n" + + "You won't be able to restore your actions after a package update.\n\n" + + "Are you sure?", + "Delete", + "Cancel")) + { + return; + } + + File.Delete(BACKUP_FILE); + + // Delete meta file too + string metaFile = BACKUP_FILE + ".meta"; + if (File.Exists(metaFile)) + { + File.Delete(metaFile); + } + + AssetDatabase.Refresh(); + Debug.Log("[OctoCore] Backup file deleted."); + } + + private static void RestoreFromBackup() + { + string actionsFile = GetActionsFilePath(); + + // Check if backup exists + if (!File.Exists(BACKUP_FILE)) + { + Debug.Log("[OctoCore] No backup found. Generate your actions via OctoSettings."); + return; + } + + // Check if actions file needs restoration (is it the template?) + if (File.Exists(actionsFile)) + { + string currentContent = File.ReadAllText(actionsFile); + + // If it contains real actions (not just None), skip restoration + if (currentContent.Contains("_PLACEHOLDER_") || currentContent.Contains("None = 0")) + { + Debug.Log("[OctoCore] Restoring actions from backup..."); + RestoreActionsFile(actionsFile); + } + else + { + // File already has real actions, don't overwrite + return; + } + } + else + { + // File doesn't exist, restore it + RestoreActionsFile(actionsFile); + } + } + + private static void RestoreActionsFile(string actionsFile) + { + try + { + // Read backup JSON + string json = File.ReadAllText(BACKUP_FILE); + var backup = JsonUtility.FromJson(json); + + if (backup == null || backup.Actions == null || backup.Actions.Count == 0) + { + Debug.LogWarning("[OctoCore] Backup file is empty or invalid."); + return; + } + + // Generate enum file from backup + StringBuilder sb = new StringBuilder(); + + sb.AppendLine("// ═══════════════════════════════════════════════════════════════════════════"); + sb.AppendLine("// AUTO-GENERATED FILE - DO NOT EDIT MANUALLY"); + sb.AppendLine("// ═══════════════════════════════════════════════════════════════════════════"); + sb.AppendLine("// Restored from backup by OctoActionsPostImport"); + sb.AppendLine($"// Original source: {backup.GeneratedFrom}"); + sb.AppendLine($"// Originally generated on: {backup.GeneratedOn}"); + sb.AppendLine($"// Restored on: {System.DateTime.Now:yyyy-MM-dd HH:mm:ss}"); + sb.AppendLine("// ═══════════════════════════════════════════════════════════════════════════"); + sb.AppendLine(); + sb.AppendLine("namespace OctoCore.Inputs"); + sb.AppendLine("{"); + sb.AppendLine(" /// "); + sb.AppendLine(" /// Actions from Unity Input Actions."); + sb.AppendLine($" /// Generated from: {backup.GeneratedFrom}"); + sb.AppendLine(" /// Format: ActionMap_ActionName"); + sb.AppendLine(" /// Values are stable hashes to prevent serialization issues when regenerating."); + sb.AppendLine(" /// "); + sb.AppendLine(" public enum OctoActions"); + sb.AppendLine(" {"); + + for (int i = 0; i < backup.Actions.Count; i++) + { + var action = backup.Actions[i]; + + if (i > 0) + sb.AppendLine(","); + + sb.AppendLine($" /// {action.MapName} > {action.ActionName}"); + sb.Append($" {action.Name} = {action.Hash}"); + } + sb.AppendLine(); + + sb.AppendLine(" }"); + sb.AppendLine("}"); + + // Ensure directory exists + string directory = Path.GetDirectoryName(actionsFile); + if (!Directory.Exists(directory)) + { + Directory.CreateDirectory(directory); + } + + // Write restored file + File.WriteAllText(actionsFile, sb.ToString()); + AssetDatabase.Refresh(); + + Debug.Log($"[OctoCore] Actions successfully restored from backup! ({backup.Actions.Count} actions)"); + } + catch (System.Exception ex) + { + Debug.LogError($"[OctoCore] Failed to restore actions from backup: {ex.Message}"); + } + } + + private static void CreateTemplate(string actionsFile) + { + string template = +@"// ═══════════════════════════════════════════════════════════════════════════ +// TEMPLATE FILE +// ═══════════════════════════════════════════════════════════════════════════ +// This is a template file for OctoActions. +// +// TO GENERATE YOUR REAL ACTIONS: +// 1. Open OctoSettings in the Inspector +// 2. Go to Mapping section +// 3. Assign your Input Action Asset +// 4. Click 'Generate Inputs' button +// +// This template allows the package to compile before actions are generated. +// ═══════════════════════════════════════════════════════════════════════════ + +namespace OctoCore.Inputs +{ + /// + /// Template enum for input actions. + /// Generate your real actions via OctoSettings > Mapping > Generate Inputs. + /// + public enum OctoActions + { + /// + /// Placeholder value. + /// This will be replaced when you generate your input actions. + /// + None = 0 + } +} +"; + + // Ensure directory exists + string directory = Path.GetDirectoryName(actionsFile); + if (!Directory.Exists(directory)) + { + Directory.CreateDirectory(directory); + } + + // Write template file + File.WriteAllText(actionsFile, template); + } + + [System.Serializable] + private class ActionBackupData + { + public string Name; + public int Hash; + public string MapName; + public string ActionName; + } + + [System.Serializable] + private class ActionsBackup + { + public string GeneratedFrom; + public string GeneratedOn; + public List Actions; + } + } +} +#endif \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoActionsPostImport.cs.meta b/Packages/OctoCore/Editor/OctoActionsPostImport.cs.meta new file mode 100644 index 00000000..aff868c8 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoActionsPostImport.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1341efd2cf48e6a42b0e4d82542aa728 \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoCore.Editor.asmdef b/Packages/OctoCore/Editor/OctoCore.Editor.asmdef new file mode 100644 index 00000000..779d1327 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoCore.Editor.asmdef @@ -0,0 +1,19 @@ +{ + "name": "OctoCore.Editor", + "rootNamespace": "OctoCore", + "references": [ + "OctoCore.Runtime", + "Unity.InputSystem" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoCore.Editor.asmdef.meta b/Packages/OctoCore/Editor/OctoCore.Editor.asmdef.meta new file mode 100644 index 00000000..4da3057e --- /dev/null +++ b/Packages/OctoCore/Editor/OctoCore.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5506ba4596c093544967197d0014b667 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Editor/OctoLevelGridEditor.cs b/Packages/OctoCore/Editor/OctoLevelGridEditor.cs new file mode 100644 index 00000000..b35a0dbf --- /dev/null +++ b/Packages/OctoCore/Editor/OctoLevelGridEditor.cs @@ -0,0 +1,30 @@ +using UnityEditor; +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /*[CustomEditor(typeof(OctoLevelGrid))] + public class OctoLevelGridEditor : Editor + { + public override void OnInspectorGUI() + { + DrawDefaultInspector(); + + OctoLevelGrid grid = (OctoLevelGrid)target; + + EditorGUILayout.Space(10); + + if (GUILayout.Button("Rebuild All Tiles")) + { + grid.RebuildAllTiles(); + Debug.Log("[OctoLevelGrid] All tiles rebuilt."); + } + + if (GUILayout.Button("Update All Wall Shapes")) + { + grid.UpdateAllWallShapes(); + Debug.Log("[OctoLevelGrid] All wall shapes updated."); + } + } + }*/ +} \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoLevelGridEditor.cs.meta b/Packages/OctoCore/Editor/OctoLevelGridEditor.cs.meta new file mode 100644 index 00000000..0b65a29f --- /dev/null +++ b/Packages/OctoCore/Editor/OctoLevelGridEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a8928c5f72a929c489249d7e786c24fa \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoLocalizedTextDataEditor.cs b/Packages/OctoCore/Editor/OctoLocalizedTextDataEditor.cs new file mode 100644 index 00000000..d3798360 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoLocalizedTextDataEditor.cs @@ -0,0 +1,34 @@ +using System; +using UnityEditor; +using UnityEngine; + +namespace OctoCore.Localization.Editor +{ +[CustomEditor(typeof(OctoLocalizedTextData))] +public class OctoLocalizedTextDataEditor : UnityEditor.Editor +{ + public override void OnInspectorGUI() + { + //DrawDefaultInspector(); + + OctoLocalizedTextData data = (OctoLocalizedTextData)target; + + //if (GUILayout.Button("Init Languages")) data.Init(); + //EditorGUILayout.Space(); + + foreach (string lang in Enum.GetNames(typeof(OctoLanguages))) + { + if (!data.Languages.ContainsKey(lang)) + data.Languages[lang] = string.Empty; + + EditorGUILayout.LabelField(lang.ToString(), EditorStyles.boldLabel); + data.Languages[lang] = EditorGUILayout.TextArea(data.Languages[lang], GUILayout.MinHeight(40)); + EditorGUILayout.Space(5); + } + + if (GUI.changed) + EditorUtility.SetDirty(data); + } +} + +} \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoLocalizedTextDataEditor.cs.meta b/Packages/OctoCore/Editor/OctoLocalizedTextDataEditor.cs.meta new file mode 100644 index 00000000..d10175c4 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoLocalizedTextDataEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1d98f82f8b1fb3746884002ecd24fed2 \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoLocalizedTextEditor.cs b/Packages/OctoCore/Editor/OctoLocalizedTextEditor.cs new file mode 100644 index 00000000..b1e9f189 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoLocalizedTextEditor.cs @@ -0,0 +1,52 @@ +using UnityEditor; +using UnityEngine; + +namespace OctoCore.Localization.Editor +{ +[CustomEditor(typeof(OctoLocalizedText))] +public class OctoLocalizedTextEditor : UnityEditor.Editor +{ + SerializedProperty dataProp; + SerializedProperty textProp; + SerializedProperty textMeshProProp; + SerializedProperty textMeshProUGUIProp; + + void OnEnable() + { + dataProp = serializedObject.FindProperty("data"); + textProp = serializedObject.FindProperty("text"); + textMeshProProp = serializedObject.FindProperty("textMeshPro"); + textMeshProUGUIProp = serializedObject.FindProperty("textMeshProUGUI"); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + EditorGUILayout.PropertyField(dataProp); + + GUI.enabled = false; + + if (textProp.objectReferenceValue != null) + { + EditorGUILayout.PropertyField(textProp, new GUIContent("Text")); + } + else if (textMeshProProp.objectReferenceValue != null) + { + EditorGUILayout.PropertyField(textMeshProProp, new GUIContent("Text")); + } + else if (textMeshProUGUIProp.objectReferenceValue != null) + { + EditorGUILayout.PropertyField(textMeshProUGUIProp, new GUIContent("Text")); + } + else + { + EditorGUILayout.HelpBox("No text componant found.", MessageType.Info); + } + + GUI.enabled = true; + + serializedObject.ApplyModifiedProperties(); + } +} +} \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoLocalizedTextEditor.cs.meta b/Packages/OctoCore/Editor/OctoLocalizedTextEditor.cs.meta new file mode 100644 index 00000000..32009fc7 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoLocalizedTextEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d0318152d87e6de409c214f43199b6de \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoReadOnlyEditor.cs b/Packages/OctoCore/Editor/OctoReadOnlyEditor.cs new file mode 100644 index 00000000..d8665b00 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoReadOnlyEditor.cs @@ -0,0 +1,22 @@ +using UnityEditor; +using UnityEngine; + +namespace OctoCore.Components.Editor +{ +[CustomPropertyDrawer(typeof(OctoReadOnlyAttribute))] +public class OCtoReadOnlyEditor: PropertyDrawer +{ + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return EditorGUI.GetPropertyHeight(property, label, true); + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + GUI.enabled = false; + EditorGUI.PropertyField(position, property, label, true); + GUI.enabled = true; + } +} + +} \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoReadOnlyEditor.cs.meta b/Packages/OctoCore/Editor/OctoReadOnlyEditor.cs.meta new file mode 100644 index 00000000..6c7d950d --- /dev/null +++ b/Packages/OctoCore/Editor/OctoReadOnlyEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7f4b5fb27a48beb4698f946e9513bcf9 \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoSaveEventEditor.cs b/Packages/OctoCore/Editor/OctoSaveEventEditor.cs new file mode 100644 index 00000000..e8a497c3 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoSaveEventEditor.cs @@ -0,0 +1,52 @@ +using UnityEditor; + +namespace OctoCore.Components.Editor +{ + [CustomEditor(typeof(OctoSaveEvent))] + public class OctoSaveEventEditor : UnityEditor.Editor + { + public override void OnInspectorGUI() + { + serializedObject.Update(); + + SerializedProperty dataProp = serializedObject.FindProperty("data"); + EditorGUILayout.PropertyField(dataProp); + + OctoSaveEvent script = (OctoSaveEvent)target; + global::OctoCore.Save.Data.OctoData data = dataProp.objectReferenceValue as global::OctoCore.Save.Data.OctoData; + + if (data != null) + { + if (data is global::OctoCore.Save.Data.OctoDataBool) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("invertValue")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("onInitBool")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("onChangeBool")); + } + else if (data is global::OctoCore.Save.Data.OctoDataInt) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("onInitInt")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("onChangeInt")); + } + else if (data is global::OctoCore.Save.Data.OctoDataFloat) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("onInitFloat")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("onChangeFloat")); + } + else if (data is global::OctoCore.Save.Data.OctoDataString) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("onInitString")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("onChangeString")); + } + else if (data is global::OctoCore.Save.Data.OctoDataVector) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("onInitVector")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("onChangeVector")); + } + } + + serializedObject.ApplyModifiedProperties(); + } + } + +} \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoSaveEventEditor.cs.meta b/Packages/OctoCore/Editor/OctoSaveEventEditor.cs.meta new file mode 100644 index 00000000..c57d3ff1 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoSaveEventEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bbf314ffdf8b0384589bfb20c78c5b67 \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoSettingsEditor.cs b/Packages/OctoCore/Editor/OctoSettingsEditor.cs new file mode 100644 index 00000000..a47a098b --- /dev/null +++ b/Packages/OctoCore/Editor/OctoSettingsEditor.cs @@ -0,0 +1,257 @@ +using OctoCore.Inputs; +using UnityEditor; +using UnityEngine; + +namespace OctoCore +{ + [CustomEditor(typeof(OctoSettings))] + public class OctoSettingsEditor : UnityEditor.Editor + { + SerializedProperty saveProp; + SerializedProperty saveBooleansProp; + SerializedProperty saveFloatsProp; + SerializedProperty saveIntegersProp; + SerializedProperty saveStringsProp; + SerializedProperty saveVectorsProp; + + SerializedProperty mappingProp; + SerializedProperty mappingInputActionAssetProp; + SerializedProperty mappingActionsProp; + + SerializedProperty languagesProp; + SerializedProperty languagesDefaultProp; + SerializedProperty languagesSaveWrittenProp; + SerializedProperty languagesSaveAudioProp; + SerializedProperty languagesOverridesProp; + + SerializedProperty scenesProp; + SerializedProperty scenesSceneDatasProp; + SerializedProperty scenesUseAddressablesProp; + SerializedProperty scenesFadeSettingsProp; + + SerializedProperty UiProp; + SerializedProperty UiReferenceSizeProp; + SerializedProperty UiIconsBackgroundProp; + + bool foldoutSave; + bool foldoutMapping; + bool foldoutLanguages; + bool foldoutScenes; + bool foldoutUi; + + void OnEnable() + { + saveProp = serializedObject.FindProperty("Save"); + saveBooleansProp = saveProp.FindPropertyRelative("Booleans"); + saveIntegersProp = saveProp.FindPropertyRelative("Integers"); + saveFloatsProp = saveProp.FindPropertyRelative("Floats"); + saveStringsProp = saveProp.FindPropertyRelative("Strings"); + saveVectorsProp = saveProp.FindPropertyRelative("Vectors"); + + mappingProp = serializedObject.FindProperty("Mapping"); + mappingInputActionAssetProp = mappingProp.FindPropertyRelative("InputActionAsset"); + mappingActionsProp = mappingProp.FindPropertyRelative("Actions"); + + languagesProp = serializedObject.FindProperty("Languages"); + languagesDefaultProp = languagesProp.FindPropertyRelative("Default"); + languagesSaveWrittenProp = languagesProp.FindPropertyRelative("SaveWritten"); + languagesSaveAudioProp = languagesProp.FindPropertyRelative("SaveAudio"); + languagesOverridesProp = languagesProp.FindPropertyRelative("Overrides"); + + scenesProp = serializedObject.FindProperty("Scenes"); + scenesSceneDatasProp = scenesProp.FindPropertyRelative("SceneDatas"); + scenesUseAddressablesProp = scenesProp.FindPropertyRelative("UseAddressables"); + scenesFadeSettingsProp = scenesProp.FindPropertyRelative("FadeSettings"); + + UiProp = serializedObject.FindProperty("Ui"); + UiReferenceSizeProp = UiProp.FindPropertyRelative("ReferenceSize"); + UiIconsBackgroundProp = UiProp.FindPropertyRelative("IconsBackground"); + } + + public override void OnInspectorGUI() + { + OctoSettings data = (OctoSettings)target; + + serializedObject.Update(); + + GUIStyle foldout = new GUIStyle(EditorStyles.foldout) { fontStyle = FontStyle.Bold }; + + // ═══════════════════════════════════════════════════════════════════ + // SAVE + // ═══════════════════════════════════════════════════════════════════ + + EditorGUILayout.BeginVertical("box"); + EditorGUI.indentLevel++; + + foldoutSave = EditorGUILayout.Foldout(foldoutSave, "SAVE", true, foldout); + + if (foldoutSave) + { + EditorGUILayout.Space(); + EditorGUI.indentLevel++; + + if (GUILayout.Button("Get All Datas")) + { + data.GetAllDatas(); + } + + EditorGUILayout.Space(); + + EditorGUILayout.PropertyField(saveBooleansProp); + EditorGUILayout.PropertyField(saveFloatsProp); + EditorGUILayout.PropertyField(saveIntegersProp); + EditorGUILayout.PropertyField(saveStringsProp); + EditorGUILayout.PropertyField(saveVectorsProp); + + EditorGUI.indentLevel--; + EditorGUILayout.Space(4); + } + + EditorGUI.indentLevel--; + EditorGUILayout.EndVertical(); + EditorGUILayout.Space(); + + // ═══════════════════════════════════════════════════════════════════ + // MAPPING + // ═══════════════════════════════════════════════════════════════════ + + EditorGUILayout.BeginVertical("box"); + EditorGUI.indentLevel++; + + foldoutMapping = EditorGUILayout.Foldout(foldoutMapping, "MAPPING", true, foldout); + + if (foldoutMapping) + { + EditorGUILayout.Space(); + +#if ENABLE_INPUT_SYSTEM + EditorGUILayout.PropertyField(mappingInputActionAssetProp); + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(mappingActionsProp); + EditorGUI.indentLevel--; + + EditorGUILayout.Space(); + + EditorGUILayout.HelpBox( + "To generate OctoActions enum:\n" + + "1. Assign an Input Action Asset first\n" + + "2. Click 'Generate Inputs'\n\n" + + "Note: The enum will be generated in Assets/OctoCore/ (safe from package updates)", + MessageType.Info + ); + + EditorGUILayout.Space(5); + + GUI.enabled = data.Mapping.InputActionAsset != null; + if (GUILayout.Button("Generate Inputs", GUILayout.Height(20))) + { + data.GenerateInputs(); + } + GUI.enabled = true; +#else + EditorGUILayout.HelpBox( + "Input System Package is not enabled.\n" + + "Please enable it in Project Settings > Player > Active Input Handling.", + MessageType.Warning + ); +#endif + + EditorGUILayout.Space(4); + } + + EditorGUI.indentLevel--; + EditorGUILayout.EndVertical(); + EditorGUILayout.Space(); + + // ═══════════════════════════════════════════════════════════════════ + // LANGUAGES + // ═══════════════════════════════════════════════════════════════════ + + EditorGUILayout.BeginVertical("box"); + EditorGUI.indentLevel++; + + foldoutLanguages = EditorGUILayout.Foldout(foldoutLanguages, "LANGUAGES", true, foldout); + + if (foldoutLanguages) + { + EditorGUILayout.Space(); + + EditorGUILayout.PropertyField(languagesDefaultProp); + EditorGUILayout.PropertyField(languagesSaveWrittenProp); + EditorGUILayout.PropertyField(languagesSaveAudioProp); + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(languagesOverridesProp); + EditorGUI.indentLevel--; + + EditorGUILayout.Space(4); + } + + EditorGUI.indentLevel--; + EditorGUILayout.EndVertical(); + EditorGUILayout.Space(); + + // ═══════════════════════════════════════════════════════════════════ + // SCENES + // ═══════════════════════════════════════════════════════════════════ + + EditorGUILayout.BeginVertical("box"); + EditorGUI.indentLevel++; + + foldoutScenes = EditorGUILayout.Foldout(foldoutScenes, "SCENES", true, foldout); + + if (foldoutScenes) + { + EditorGUILayout.Space(); + EditorGUI.indentLevel++; + + if (GUILayout.Button("Get All Scene Datas")) + { + data.GetAllSceneDatas(); + } + + EditorGUILayout.Space(); + + EditorGUILayout.PropertyField(scenesSceneDatasProp); + EditorGUILayout.PropertyField(scenesUseAddressablesProp); + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Fade Settings", EditorStyles.boldLabel); + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(scenesFadeSettingsProp); + EditorGUI.indentLevel--; + + EditorGUI.indentLevel--; + EditorGUILayout.Space(4); + } + + EditorGUI.indentLevel--; + EditorGUILayout.EndVertical(); + EditorGUILayout.Space(); + + // ═══════════════════════════════════════════════════════════════════ + // UI + // ═══════════════════════════════════════════════════════════════════ + + EditorGUILayout.BeginVertical("box"); + EditorGUI.indentLevel++; + + foldoutUi = EditorGUILayout.Foldout(foldoutUi, "INTERFACE", true, foldout); + + if (foldoutUi) + { + EditorGUILayout.Space(); + + EditorGUILayout.PropertyField(UiReferenceSizeProp); + EditorGUILayout.PropertyField(UiIconsBackgroundProp); + + EditorGUILayout.Space(4); + } + + EditorGUI.indentLevel--; + EditorGUILayout.EndVertical(); + EditorGUILayout.Space(); + + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Packages/OctoCore/Editor/OctoSettingsEditor.cs.meta b/Packages/OctoCore/Editor/OctoSettingsEditor.cs.meta new file mode 100644 index 00000000..1903a3cf --- /dev/null +++ b/Packages/OctoCore/Editor/OctoSettingsEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9ce5e44ae6718e44fa7cf22c8cc4df5d \ No newline at end of file diff --git a/Packages/OctoCore/Editor/OctoTileEditor.cs b/Packages/OctoCore/Editor/OctoTileEditor.cs new file mode 100644 index 00000000..b64ded3e --- /dev/null +++ b/Packages/OctoCore/Editor/OctoTileEditor.cs @@ -0,0 +1,65 @@ +using UnityEditor; +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /*[CustomEditor(typeof(OctoTile))] + [CanEditMultipleObjects] + public class OctoTileEditor : Editor + { + private SerializedProperty _configurationProp; + private SerializedProperty _referencesProp; + private SerializedProperty _placementProp; + private SerializedProperty _wallProp; + + private void OnEnable() + { + _configurationProp = serializedObject.FindProperty("Configuration"); + _referencesProp = serializedObject.FindProperty("References"); + _placementProp = serializedObject.FindProperty("Placement"); + _wallProp = serializedObject.FindProperty("Wall"); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + EditorGUILayout.PropertyField(_configurationProp, true); + EditorGUILayout.PropertyField(_referencesProp, true); + EditorGUILayout.PropertyField(_placementProp, true); + + bool hasWall = false; + if (targets.Length == 1) + { + OctoTile tile = (OctoTile)target; + hasWall = tile.HasWall(); + } + else + { + foreach (var t in targets) + { + OctoTile tile = (OctoTile)t; + if (tile.HasWall()) + { + hasWall = true; + break; + } + } + } + + if (hasWall) + { + EditorGUILayout.PropertyField(_wallProp, true); + } + + if (serializedObject.ApplyModifiedProperties()) + { + foreach (var t in targets) + { + OctoTile tile = (OctoTile)t; + tile.RefreshTile(); + } + } + } + }*/ +} diff --git a/Packages/OctoCore/Editor/OctoTileEditor.cs.meta b/Packages/OctoCore/Editor/OctoTileEditor.cs.meta new file mode 100644 index 00000000..74153609 --- /dev/null +++ b/Packages/OctoCore/Editor/OctoTileEditor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0fdd28ef8abb6df47b9e13a6b6df43aa \ No newline at end of file diff --git a/Packages/OctoCore/Runtime.meta b/Packages/OctoCore/Runtime.meta new file mode 100644 index 00000000..4183e4c9 --- /dev/null +++ b/Packages/OctoCore/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5a324914a10812c42ae63e3ab6bb6d7b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Data.meta b/Packages/OctoCore/Runtime/Data.meta new file mode 100644 index 00000000..55811bc6 --- /dev/null +++ b/Packages/OctoCore/Runtime/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7a18bc4bcd1fa545b15847be1caca1f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Data/language_audio.asset b/Packages/OctoCore/Runtime/Data/language_audio.asset new file mode 100644 index 00000000..1bd64e2a --- /dev/null +++ b/Packages/OctoCore/Runtime/Data/language_audio.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d98ebfcec71f3a247b658908e9fee900, type: 3} + m_Name: language_audio + m_EditorClassIdentifier: + Id: language_audio + Value: diff --git a/Packages/OctoCore/Runtime/Data/language_audio.asset.meta b/Packages/OctoCore/Runtime/Data/language_audio.asset.meta new file mode 100644 index 00000000..0954829e --- /dev/null +++ b/Packages/OctoCore/Runtime/Data/language_audio.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a186262be747dae448e59cbe43ebe286 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Data/language_written.asset b/Packages/OctoCore/Runtime/Data/language_written.asset new file mode 100644 index 00000000..80ceac10 --- /dev/null +++ b/Packages/OctoCore/Runtime/Data/language_written.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d98ebfcec71f3a247b658908e9fee900, type: 3} + m_Name: language_written + m_EditorClassIdentifier: + Id: language_written + Value: diff --git a/Packages/OctoCore/Runtime/Data/language_written.asset.meta b/Packages/OctoCore/Runtime/Data/language_written.asset.meta new file mode 100644 index 00000000..cf09cf72 --- /dev/null +++ b/Packages/OctoCore/Runtime/Data/language_written.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70ce020f0ed1ad24a94c854da5d6538e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Data/settings_global.asset b/Packages/OctoCore/Runtime/Data/settings_global.asset new file mode 100644 index 00000000..925d42bb --- /dev/null +++ b/Packages/OctoCore/Runtime/Data/settings_global.asset @@ -0,0 +1,154 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c12f834718fa7c2479f8a954db0682ec, type: 3} + m_Name: settings_global + m_EditorClassIdentifier: + Save: + Booleans: [] + Integers: [] + Floats: [] + Strings: + - {fileID: 11400000, guid: a186262be747dae448e59cbe43ebe286, type: 2} + - {fileID: 11400000, guid: 70ce020f0ed1ad24a94c854da5d6538e, type: 2} + Vectors: [] + Mapping: + InputActionAsset: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} + ActionMaps: + - Name: Player + Map: 0 + Actions: + - Name: Move + Action: 0 + Reference: {fileID: -1680190386980627800, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Look + Action: 1 + Reference: {fileID: -5630151704836100654, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Attack + Action: 2 + Reference: {fileID: 1120369429361536294, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Interact + Action: 3 + Reference: {fileID: 1781555164194001046, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Crouch + Action: 4 + Reference: {fileID: 7040659881675835329, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Jump + Action: 5 + Reference: {fileID: -2099379676528639254, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Previous + Action: 6 + Reference: {fileID: 2411907206095950430, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Next + Action: 7 + Reference: {fileID: 7476244043514120974, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Sprint + Action: 8 + Reference: {fileID: -7471211009204490832, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: UI + Map: 1 + Actions: + - Name: Navigate + Action: 9 + Reference: {fileID: -8784545083839296357, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Submit + Action: 10 + Reference: {fileID: 392368643174621059, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Cancel + Action: 11 + Reference: {fileID: 7727032971491509709, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Point + Action: 12 + Reference: {fileID: -1654692200621890270, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: Click + Action: 13 + Reference: {fileID: 3001919216989983466, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: RightClick + Action: 14 + Reference: {fileID: -4090225696740746782, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: MiddleClick + Action: 15 + Reference: {fileID: -2185481485913320682, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: ScrollWheel + Action: 16 + Reference: {fileID: 6240969308177333660, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: TrackedDevicePosition + Action: 17 + Reference: {fileID: 6564999863303420839, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + - Name: TrackedDeviceOrientation + Action: 18 + Reference: {fileID: 7970375526676320489, guid: 052faaac586de48259a63d0c4782560b, type: 3} + Icon: + UseName: 1 + Sprite: {fileID: 0} + Languages: + Default: 1 + SaveWritten: {fileID: 11400000, guid: 70ce020f0ed1ad24a94c854da5d6538e, type: 2} + SaveAudio: {fileID: 11400000, guid: a186262be747dae448e59cbe43ebe286, type: 2} + Overrides: [] + Ui: + ReferenceSize: {x: 1440, y: 3120} + IconsBackground: + DefaultButton: {fileID: 0} diff --git a/Packages/OctoCore/Runtime/Data/settings_global.asset.meta b/Packages/OctoCore/Runtime/Data/settings_global.asset.meta new file mode 100644 index 00000000..426619cc --- /dev/null +++ b/Packages/OctoCore/Runtime/Data/settings_global.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1fc9111689f694145b60db4014028b18 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models.meta b/Packages/OctoCore/Runtime/Models.meta new file mode 100644 index 00000000..7a28156b --- /dev/null +++ b/Packages/OctoCore/Runtime/Models.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7c7b241b78956b74ebf9b66fc8388c1c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/arms.meta b/Packages/OctoCore/Runtime/Models/arms.meta new file mode 100644 index 00000000..d634b3f1 --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/arms.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6d6c36933f532c143affffb1d4c87fd5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/arms/arms.fbx b/Packages/OctoCore/Runtime/Models/arms/arms.fbx new file mode 100644 index 00000000..ba5d5a2d Binary files /dev/null and b/Packages/OctoCore/Runtime/Models/arms/arms.fbx differ diff --git a/Packages/OctoCore/Runtime/Models/arms/arms.fbx.meta b/Packages/OctoCore/Runtime/Models/arms/arms.fbx.meta new file mode 100644 index 00000000..77caffee --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/arms/arms.fbx.meta @@ -0,0 +1,115 @@ +fileFormatVersion: 2 +guid: e4ee9e9425025a7409c3fbd040c04853 +ModelImporter: + serializedVersion: 24200 + internalIDToNameTable: [] + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: standardSurface1 + second: {fileID: 2100000, guid: 213f1a4f73614884ba6a065aa06283b5, type: 2} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + generateMeshLods: 0 + meshLodGenerationFlags: 0 + maximumMeshLod: -1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/arms/mat_arms.mat b/Packages/OctoCore/Runtime/Models/arms/mat_arms.mat new file mode 100644 index 00000000..948a4f02 --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/arms/mat_arms.mat @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6241688233005360601 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: mat_arms + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _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} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _UVSec: 0 + - _WorkflowMode: 1 + - _XRMotionVectorsPass: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 0.9245283, g: 0.85435545, b: 0.75444996, a: 1} + - _Color: {r: 0.9245283, g: 0.85435545, b: 0.75444996, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Packages/OctoCore/Runtime/Models/arms/mat_arms.mat.meta b/Packages/OctoCore/Runtime/Models/arms/mat_arms.mat.meta new file mode 100644 index 00000000..3848d200 --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/arms/mat_arms.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 213f1a4f73614884ba6a065aa06283b5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/dad.meta b/Packages/OctoCore/Runtime/Models/dad.meta new file mode 100644 index 00000000..860b9d8e --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0e7e85ad5befd6a4da94af5bf167f28a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/dad/dad.controller b/Packages/OctoCore/Runtime/Models/dad/dad.controller new file mode 100644 index 00000000..7a6ec981 --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad/dad.controller @@ -0,0 +1,257 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!206 &-6296890662589978932 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BlendTree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 8886403592489223659} + m_Threshold: 0 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: move + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 1827226128182048838, guid: 23000d32d75602d479f8506239cdb0ed, type: 3} + m_Threshold: 1 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: move + m_Mirror: 0 + m_BlendParameter: run + m_BlendParameterY: Blend + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +--- !u!206 &-4879062819497881735 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BlendTree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 1827226128182048838, guid: 151f05c2bf688504d9122a65a1cc4ed2, type: 3} + m_Threshold: 0 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: move + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 1827226128182048838, guid: 072a284256ac39848aae7bb60b492d7b, type: 3} + m_Threshold: 1 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: move + m_Mirror: 0 + m_BlendParameter: backward + m_BlendParameterY: Blend + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 1 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: dad + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: trigger_move + m_Type: 9 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: move + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: backward + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: side + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: run + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 6350601263350617281} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &5484812774151747158 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: move + m_Speed: 1.2 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 5926010261774489586} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &5508769876683809156 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 5484812774151747158} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!206 &5926010261774489586 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blend Tree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 1827226128182048838, guid: 3119dee0e86de7941add52db7b9e4a52, type: 3} + m_Threshold: 0 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: Move + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: -6296890662589978932} + m_Threshold: 1 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: move + m_Mirror: 0 + m_BlendParameter: move + m_BlendParameterY: forward + m_MinThreshold: 0 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 +--- !u!1107 &6350601263350617281 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 5484812774151747158} + m_Position: {x: 320, y: 110, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: + - {fileID: 5508769876683809156} + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 40, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 5484812774151747158} +--- !u!206 &8886403592489223659 +BlendTree: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BlendTree + m_Childs: + - serializedVersion: 2 + m_Motion: {fileID: 1827226128182048838, guid: ed67f1662f580074fafcd867dd2b1030, type: 3} + m_Threshold: -1 + m_Position: {x: 0, y: 0} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: move + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: -4879062819497881735} + m_Threshold: 0 + m_Position: {x: -0.96, y: 0.26} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: move + m_Mirror: 0 + - serializedVersion: 2 + m_Motion: {fileID: 1827226128182048838, guid: 7aa89e63df46be74fbd171c1fb1845ad, type: 3} + m_Threshold: 1 + m_Position: {x: 0, y: 1} + m_TimeScale: 1 + m_CycleOffset: 0 + m_DirectBlendParameter: move + m_Mirror: 0 + m_BlendParameter: side + m_BlendParameterY: backward + m_MinThreshold: -1 + m_MaxThreshold: 1 + m_UseAutomaticThresholds: 0 + m_NormalizedBlendValues: 0 + m_BlendType: 0 diff --git a/Packages/OctoCore/Runtime/Models/dad/dad.controller.meta b/Packages/OctoCore/Runtime/Models/dad/dad.controller.meta new file mode 100644 index 00000000..99cfd56f --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad/dad.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c91374d232ed57a468afca1fcbeaa451 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/dad/dad.fbx b/Packages/OctoCore/Runtime/Models/dad/dad.fbx new file mode 100644 index 00000000..1471de30 Binary files /dev/null and b/Packages/OctoCore/Runtime/Models/dad/dad.fbx differ diff --git a/Packages/OctoCore/Runtime/Models/dad/dad.fbx.meta b/Packages/OctoCore/Runtime/Models/dad/dad.fbx.meta new file mode 100644 index 00000000..98768d82 --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad/dad.fbx.meta @@ -0,0 +1,107 @@ +fileFormatVersion: 2 +guid: df51a8861bd93f24ba2f00ec49e869fa +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@idle.fbx b/Packages/OctoCore/Runtime/Models/dad/dad@idle.fbx new file mode 100644 index 00000000..60c83ddd Binary files /dev/null and b/Packages/OctoCore/Runtime/Models/dad/dad@idle.fbx differ diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@idle.fbx.meta b/Packages/OctoCore/Runtime/Models/dad/dad@idle.fbx.meta new file mode 100644 index 00000000..3a902df5 --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad/dad@idle.fbx.meta @@ -0,0 +1,136 @@ +fileFormatVersion: 2 +guid: 3119dee0e86de7941add52db7b9e4a52 +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: + - serializedVersion: 16 + name: idle + takeName: Take 001 + internalID: 1827226128182048838 + firstFrame: 0 + lastFrame: 300 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@run.fbx b/Packages/OctoCore/Runtime/Models/dad/dad@run.fbx new file mode 100644 index 00000000..40866f68 Binary files /dev/null and b/Packages/OctoCore/Runtime/Models/dad/dad@run.fbx differ diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@run.fbx.meta b/Packages/OctoCore/Runtime/Models/dad/dad@run.fbx.meta new file mode 100644 index 00000000..c2ac17ee --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad/dad@run.fbx.meta @@ -0,0 +1,136 @@ +fileFormatVersion: 2 +guid: 23000d32d75602d479f8506239cdb0ed +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: + - serializedVersion: 16 + name: run + takeName: Take 001 + internalID: 1827226128182048838 + firstFrame: 0 + lastFrame: 45 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@walk.fbx b/Packages/OctoCore/Runtime/Models/dad/dad@walk.fbx new file mode 100644 index 00000000..7d10b2fc Binary files /dev/null and b/Packages/OctoCore/Runtime/Models/dad/dad@walk.fbx differ diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@walk.fbx.meta b/Packages/OctoCore/Runtime/Models/dad/dad@walk.fbx.meta new file mode 100644 index 00000000..4d4757f8 --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad/dad@walk.fbx.meta @@ -0,0 +1,136 @@ +fileFormatVersion: 2 +guid: 151f05c2bf688504d9122a65a1cc4ed2 +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: + - serializedVersion: 16 + name: walk + takeName: Take 001 + internalID: 1827226128182048838 + firstFrame: 0 + lastFrame: 60 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@walkBack.fbx b/Packages/OctoCore/Runtime/Models/dad/dad@walkBack.fbx new file mode 100644 index 00000000..e6b7e0f9 Binary files /dev/null and b/Packages/OctoCore/Runtime/Models/dad/dad@walkBack.fbx differ diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@walkBack.fbx.meta b/Packages/OctoCore/Runtime/Models/dad/dad@walkBack.fbx.meta new file mode 100644 index 00000000..49f21f96 --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad/dad@walkBack.fbx.meta @@ -0,0 +1,136 @@ +fileFormatVersion: 2 +guid: 072a284256ac39848aae7bb60b492d7b +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: + - serializedVersion: 16 + name: walkBack + takeName: Take 001 + internalID: 1827226128182048838 + firstFrame: 0 + lastFrame: 60 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@walkLeft.fbx b/Packages/OctoCore/Runtime/Models/dad/dad@walkLeft.fbx new file mode 100644 index 00000000..93a4132b Binary files /dev/null and b/Packages/OctoCore/Runtime/Models/dad/dad@walkLeft.fbx differ diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@walkLeft.fbx.meta b/Packages/OctoCore/Runtime/Models/dad/dad@walkLeft.fbx.meta new file mode 100644 index 00000000..6c5cbcfe --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad/dad@walkLeft.fbx.meta @@ -0,0 +1,136 @@ +fileFormatVersion: 2 +guid: ed67f1662f580074fafcd867dd2b1030 +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: + - serializedVersion: 16 + name: walkLeft + takeName: Take 001 + internalID: 1827226128182048838 + firstFrame: 0 + lastFrame: 60 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@walkRight.fbx b/Packages/OctoCore/Runtime/Models/dad/dad@walkRight.fbx new file mode 100644 index 00000000..0004c8f4 Binary files /dev/null and b/Packages/OctoCore/Runtime/Models/dad/dad@walkRight.fbx differ diff --git a/Packages/OctoCore/Runtime/Models/dad/dad@walkRight.fbx.meta b/Packages/OctoCore/Runtime/Models/dad/dad@walkRight.fbx.meta new file mode 100644 index 00000000..195f6894 --- /dev/null +++ b/Packages/OctoCore/Runtime/Models/dad/dad@walkRight.fbx.meta @@ -0,0 +1,136 @@ +fileFormatVersion: 2 +guid: 7aa89e63df46be74fbd171c1fb1845ad +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: + - serializedVersion: 16 + name: walkRight + takeName: Take 001 + internalID: 1827226128182048838 + firstFrame: 0 + lastFrame: 60 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/OctoCore.Runtime.asmdef b/Packages/OctoCore/Runtime/OctoCore.Runtime.asmdef new file mode 100644 index 00000000..262fc59a --- /dev/null +++ b/Packages/OctoCore/Runtime/OctoCore.Runtime.asmdef @@ -0,0 +1,17 @@ +{ + "name": "OctoCore.Runtime", + "rootNamespace": "OctoCore", + "references": [ + "GUID:75469ad4d38634e559750d17036d5f7c", + "GUID:6055be8ebefd69e48b49212b09b47b2f" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/OctoCore.Runtime.asmdef.meta b/Packages/OctoCore/Runtime/OctoCore.Runtime.asmdef.meta new file mode 100644 index 00000000..bc6a98fd --- /dev/null +++ b/Packages/OctoCore/Runtime/OctoCore.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fba19c621e5d56141bc742c55d17e06a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Prefabs.meta b/Packages/OctoCore/Runtime/Prefabs.meta new file mode 100644 index 00000000..e8c8d228 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8ac0ffdd8fd350d439d43e3609561b13 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoArms.prefab b/Packages/OctoCore/Runtime/Prefabs/OctoArms.prefab new file mode 100644 index 00000000..d27254b0 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoArms.prefab @@ -0,0 +1,1422 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &747989681526323593 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6729180175069464909} + m_Layer: 0 + m_Name: Target_L + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6729180175069464909 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747989681526323593} + serializedVersion: 2 + m_LocalRotation: {x: 0.4999997, y: 0.50000185, z: 0.50000024, w: 0.4999982} + m_LocalPosition: {x: -0.10000001, y: -0.11799991, z: 0.38200003} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5469352163685454240} + m_LocalEulerAnglesHint: {x: 180, y: -90, z: -90} +--- !u!1 &989187519706661308 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4245779101658522270} + m_Layer: 0 + m_Name: Raycast_R_2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4245779101658522270 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 989187519706661308} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0.4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2736084570026017097} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!1 &2472340731114461256 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2736084570026017097} + m_Layer: 0 + m_Name: Raycasts_R + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2736084570026017097 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2472340731114461256} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 968400598511252888} + - {fileID: 6868471396772723999} + - {fileID: 4245779101658522270} + m_Father: {fileID: 6371905255704357408} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3534670659337081925 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5469352163685454240} + - component: {fileID: 9208847140532743279} + m_Layer: 0 + m_Name: Ik L + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5469352163685454240 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3534670659337081925} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: 0.000000013969839, w: 1} + m_LocalPosition: {x: -0.2, y: 1.458, z: -0.082} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2656140929319940858} + - {fileID: 6729180175069464909} + - {fileID: 2072281234324016569} + m_Father: {fileID: 520098895314436283} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &9208847140532743279 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3534670659337081925} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f5a9786856021274fbe10be8b0cef721, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OctoIkLimb + _joints: + Start: {fileID: 3193146119612198720} + Mid: {fileID: 1005081395328437407} + End: {fileID: 4181805340600085795} + _controllers: + Target: {fileID: 6729180175069464909} + Pole: {fileID: 2072281234324016569} + _settings: + PrimaryAxis: 2 + SecondaryAxis: 1 + Weight: 1 + OrientEnd: 1 + _debug: + Gizmos: 1 + Size: 0.1 +--- !u!1 &3663664699525650467 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1871096010787708179} + m_Layer: 0 + m_Name: Raycast_L_2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1871096010787708179 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3663664699525650467} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: -0, y: -0, z: 0.4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2656140929319940858} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!1 &3838636932869701664 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6371905255704357408} + - component: {fileID: 7309382113032576256} + m_Layer: 0 + m_Name: Ik R + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6371905255704357408 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3838636932869701664} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.2, y: 1.458, z: -0.081999995} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2736084570026017097} + - {fileID: 905104535459292698} + - {fileID: 5001575734268334496} + m_Father: {fileID: 520098895314436283} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7309382113032576256 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3838636932869701664} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f5a9786856021274fbe10be8b0cef721, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OctoIkLimb + _joints: + Start: {fileID: 4194213612049569317} + Mid: {fileID: 8997631150325690647} + End: {fileID: 6191648371188871749} + _controllers: + Target: {fileID: 905104535459292698} + Pole: {fileID: 5001575734268334496} + _settings: + PrimaryAxis: 3 + SecondaryAxis: 1 + Weight: 1 + OrientEnd: 1 + _debug: + Gizmos: 1 + Size: 0.1 +--- !u!1 &5092507422362424692 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3854893824720358325} + m_Layer: 0 + m_Name: Raycast_L_0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3854893824720358325 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5092507422362424692} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2656140929319940858} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5369054369363886801 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7939001859543297587} + m_Layer: 0 + m_Name: Raycast_L_1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7939001859543297587 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5369054369363886801} + serializedVersion: 2 + m_LocalRotation: {x: 0.08189965, y: -0.3407186, z: 0.029809028, w: 0.9361168} + m_LocalPosition: {x: 0, y: 0, z: 0.15} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2656140929319940858} + m_LocalEulerAnglesHint: {x: 10, y: -40, z: 0} +--- !u!1 &5496159857340356220 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5001575734268334496} + m_Layer: 0 + m_Name: Pole_R + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5001575734268334496 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5496159857340356220} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.2, y: -0.46799994, z: -0.11800001} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6371905255704357408} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &5954255447580342337 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 905104535459292698} + m_Layer: 0 + m_Name: Target_R + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &905104535459292698 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5954255447580342337} + serializedVersion: 2 + m_LocalRotation: {x: -0.5000019, y: 0.50000024, z: -0.4999982, w: 0.4999997} + m_LocalPosition: {x: 0.10000001, y: -0.11799991, z: 0.382} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6371905255704357408} + m_LocalEulerAnglesHint: {x: 0, y: 90, z: -90} +--- !u!1 &6441172920325274392 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 968400598511252888} + m_Layer: 0 + m_Name: Raycast_R_0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &968400598511252888 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6441172920325274392} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: 0.000000013969839, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2736084570026017097} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7915309634165337327 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2072281234324016569} + m_Layer: 0 + m_Name: Pole_L + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2072281234324016569 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7915309634165337327} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0.000000013969839, w: 1} + m_LocalPosition: {x: -0.20000002, y: -0.46799994, z: -0.118} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5469352163685454240} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7965498753575978651 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6868471396772723999} + m_Layer: 0 + m_Name: Raycast_R_1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6868471396772723999 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7965498753575978651} + serializedVersion: 2 + m_LocalRotation: {x: 0.08189965, y: 0.3407186, z: -0.029809028, w: 0.9361168} + m_LocalPosition: {x: 0, y: 0, z: 0.15} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2736084570026017097} + m_LocalEulerAnglesHint: {x: 10, y: 40, z: 0} +--- !u!1 &8759877854623267260 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2656140929319940858} + m_Layer: 0 + m_Name: Raycast_L + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2656140929319940858 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8759877854623267260} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3854893824720358325} + - {fileID: 7939001859543297587} + - {fileID: 1871096010787708179} + m_Father: {fileID: 5469352163685454240} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &53333245788890960 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8869993101917788684, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -8869993101917788684, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -8869993101917788684, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8869993101917788684, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8869993101917788684, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8529851333665882118, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -8529851333665882118, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -8529851333665882118, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8529851333665882118, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8529851333665882118, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -8516963483769617881, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -8516963483769617881, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -8516963483769617881, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8516963483769617881, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8516963483769617881, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -8264177361028584497, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.8366378 + objectReference: {fileID: 0} + - target: {fileID: -8264177361028584497, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.5477566 + objectReference: {fileID: 0} + - target: {fileID: -8264177361028584497, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: -0.000000029802319 + objectReference: {fileID: 0} + - target: {fileID: -8264177361028584497, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0.0000000745058 + objectReference: {fileID: 0} + - target: {fileID: -8264177361028584497, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 66.427 + objectReference: {fileID: 0} + - target: {fileID: -8233195766868455180, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -8233195766868455180, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -8233195766868455180, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8233195766868455180, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8233195766868455180, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -7852014885798025698, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -7852014885798025698, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -7852014885798025698, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -7852014885798025698, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -7852014885798025698, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -7550076552500161810, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -7550076552500161810, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -7550076552500161810, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -7550076552500161810, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -7550076552500161810, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -7539144479075099479, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.99605846 + objectReference: {fileID: 0} + - target: {fileID: -7539144479075099479, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08714387 + objectReference: {fileID: 0} + - target: {fileID: -7539144479075099479, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: -0.0014412305 + objectReference: {fileID: 0} + - target: {fileID: -7539144479075099479, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0.016473332 + objectReference: {fileID: 0} + - target: {fileID: -7539144479075099479, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -7539144479075099479, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.895 + objectReference: {fileID: 0} + - target: {fileID: -6879105992191384851, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -6879105992191384851, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -6879105992191384851, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -6879105992191384851, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -6879105992191384851, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -5682503446063470330, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -5682503446063470330, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -5682503446063470330, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -5682503446063470330, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -5682503446063470330, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -5672558643779430391, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -5672558643779430391, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -5672558643779430391, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -5672558643779430391, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -5672558643779430391, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -5544367256629032447, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -5544367256629032447, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -5544367256629032447, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -5544367256629032447, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -5544367256629032447, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -4991615071906084448, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9954686 + objectReference: {fileID: 0} + - target: {fileID: -4991615071906084448, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08755801 + objectReference: {fileID: 0} + - target: {fileID: -4991615071906084448, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: -0.009395132 + objectReference: {fileID: 0} + - target: {fileID: -4991615071906084448, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: -0.035882715 + objectReference: {fileID: 0} + - target: {fileID: -4991615071906084448, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -4991615071906084448, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.454 + objectReference: {fileID: 0} + - target: {fileID: -4991615071906084448, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.256 + objectReference: {fileID: 0} + - target: {fileID: -3949019280762474395, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -3949019280762474395, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -3949019280762474395, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -3949019280762474395, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -3949019280762474395, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -2453527963877410037, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -2453527963877410037, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -2453527963877410037, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -2453527963877410037, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -2453527963877410037, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -2234031343915514281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -2234031343915514281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -2234031343915514281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -2234031343915514281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -2234031343915514281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -1176079171843648056, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -1176079171843648056, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -1176079171843648056, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -1176079171843648056, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -1176079171843648056, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -100482775946282094, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: -100482775946282094, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: -100482775946282094, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -100482775946282094, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -100482775946282094, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -56339845312256954, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961336 + objectReference: {fileID: 0} + - target: {fileID: -56339845312256954, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715044 + objectReference: {fileID: 0} + - target: {fileID: -56339845312256954, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: -0.00096515036 + objectReference: {fileID: 0} + - target: {fileID: -56339845312256954, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0.011031713 + objectReference: {fileID: 0} + - target: {fileID: -56339845312256954, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: -56339845312256954, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.269 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_Name + value: OctoArms + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1707439010205345278, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 1707439010205345278, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 1707439010205345278, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1707439010205345278, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1707439010205345278, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2628519816182720739, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 2628519816182720739, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 2628519816182720739, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2628519816182720739, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2628519816182720739, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2869910437546099883, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 2869910437546099883, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 2869910437546099883, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2869910437546099883, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2869910437546099883, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalPosition.x + value: -0.2 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalPosition.y + value: 1.458 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalPosition.z + value: -0.082 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.37084988 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.016857767 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0.29630813 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0.879993 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -30.597 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 16.845 + objectReference: {fileID: 0} + - target: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 129.658 + objectReference: {fileID: 0} + - target: {fileID: 3952944406070161283, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.99605846 + objectReference: {fileID: 0} + - target: {fileID: 3952944406070161283, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08714387 + objectReference: {fileID: 0} + - target: {fileID: 3952944406070161283, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: -0.0014412305 + objectReference: {fileID: 0} + - target: {fileID: 3952944406070161283, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0.016473332 + objectReference: {fileID: 0} + - target: {fileID: 3952944406070161283, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 3952944406070161283, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.895 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalPosition.x + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalPosition.y + value: 1.458 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalPosition.z + value: -0.081999995 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.016857836 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: -0.3708498 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0.87999314 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: -0.29630783 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 30.597 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 163.155 + objectReference: {fileID: 0} + - target: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -50.342 + objectReference: {fileID: 0} + - target: {fileID: 4230493587302484595, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.98375815 + objectReference: {fileID: 0} + - target: {fileID: 4230493587302484595, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: -0.015272317 + objectReference: {fileID: 0} + - target: {fileID: 4230493587302484595, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: -0.17880653 + objectReference: {fileID: 0} + - target: {fileID: 4230493587302484595, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: -0.0038798 + objectReference: {fileID: 0} + - target: {fileID: 4230493587302484595, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.801 + objectReference: {fileID: 0} + - target: {fileID: 4230493587302484595, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -20.601 + objectReference: {fileID: 0} + - target: {fileID: 4230493587302484595, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.125 + objectReference: {fileID: 0} + - target: {fileID: 5317023638929584776, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 5317023638929584776, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 5317023638929584776, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5317023638929584776, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5317023638929584776, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 6147515945576404245, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9837582 + objectReference: {fileID: 0} + - target: {fileID: 6147515945576404245, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: -0.01527008 + objectReference: {fileID: 0} + - target: {fileID: 6147515945576404245, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: -0.17880575 + objectReference: {fileID: 0} + - target: {fileID: 6147515945576404245, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: -0.0038811108 + objectReference: {fileID: 0} + - target: {fileID: 6147515945576404245, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.801 + objectReference: {fileID: 0} + - target: {fileID: 6147515945576404245, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -20.601 + objectReference: {fileID: 0} + - target: {fileID: 6147515945576404245, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.125 + objectReference: {fileID: 0} + - target: {fileID: 6642182342394084487, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9954686 + objectReference: {fileID: 0} + - target: {fileID: 6642182342394084487, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08755801 + objectReference: {fileID: 0} + - target: {fileID: 6642182342394084487, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: -0.009395132 + objectReference: {fileID: 0} + - target: {fileID: 6642182342394084487, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: -0.035882715 + objectReference: {fileID: 0} + - target: {fileID: 6642182342394084487, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 6642182342394084487, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.454 + objectReference: {fileID: 0} + - target: {fileID: 6642182342394084487, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.256 + objectReference: {fileID: 0} + - target: {fileID: 6656833911575896123, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 6656833911575896123, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 6656833911575896123, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6656833911575896123, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6656833911575896123, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 7259330821527794153, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 7259330821527794153, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 7259330821527794153, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7259330821527794153, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7259330821527794153, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 7380578647484004266, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 7380578647484004266, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 7380578647484004266, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7380578647484004266, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7380578647484004266, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 8205160414342519281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 8205160414342519281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 8205160414342519281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8205160414342519281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8205160414342519281, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 8963143549970404935, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.w + value: 0.8366381 + objectReference: {fileID: 0} + - target: {fileID: 8963143549970404935, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.x + value: 0.5477562 + objectReference: {fileID: 0} + - target: {fileID: 8963143549970404935, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.y + value: -0.000000029802322 + objectReference: {fileID: 0} + - target: {fileID: 8963143549970404935, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalRotation.z + value: 0.000000014901161 + objectReference: {fileID: 0} + - target: {fileID: 8963143549970404935, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 66.426 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + insertIndex: -1 + addedObject: {fileID: 5469352163685454240} + - targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + insertIndex: -1 + addedObject: {fileID: 6371905255704357408} + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + insertIndex: -1 + addedObject: {fileID: 880987313172909187} + m_SourcePrefab: {fileID: 100100000, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} +--- !u!4 &520098895314436283 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + m_PrefabInstance: {fileID: 53333245788890960} + m_PrefabAsset: {fileID: 0} +--- !u!1 &899615586671794689 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + m_PrefabInstance: {fileID: 53333245788890960} + m_PrefabAsset: {fileID: 0} +--- !u!114 &880987313172909187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 899615586671794689} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 015ed493fd8775f479bf25c92aa04e57, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OctoIkArms + _leftArm: + Enabled: 1 + Arm: {fileID: 9208847140532743279} + RotationOffset: {x: 0, y: 90, z: -15} + Raycasts: + - Root: {fileID: 3854893824720358325} + Distance: 0.7 + - Root: {fileID: 7939001859543297587} + Distance: 0.5 + - Root: {fileID: 1871096010787708179} + Distance: 0.6 + TargetOriginPos: {x: 0, y: 0, z: 0} + TargetOriginRot: {x: 0, y: 0, z: 0, w: 0} + PoleOriginPos: {x: 0, y: 0, z: 0} + _rightArm: + Enabled: 1 + Arm: {fileID: 7309382113032576256} + RotationOffset: {x: 0, y: 90, z: -195} + Raycasts: + - Root: {fileID: 968400598511252888} + Distance: 0.7 + - Root: {fileID: 6868471396772723999} + Distance: 0.5 + - Root: {fileID: 4245779101658522270} + Distance: 0.6 + TargetOriginPos: {x: 0, y: 0, z: 0} + TargetOriginRot: {x: 0, y: 0, z: 0, w: 0} + PoleOriginPos: {x: 0, y: 0, z: 0} + _settings: + LayerMask: + serializedVersion: 2 + m_Bits: 524288 +--- !u!4 &1005081395328437407 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -8264177361028584497, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + m_PrefabInstance: {fileID: 53333245788890960} + m_PrefabAsset: {fileID: 0} +--- !u!4 &3193146119612198720 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3237295623616186384, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + m_PrefabInstance: {fileID: 53333245788890960} + m_PrefabAsset: {fileID: 0} +--- !u!4 &4181805340600085795 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4230493587302484595, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + m_PrefabInstance: {fileID: 53333245788890960} + m_PrefabAsset: {fileID: 0} +--- !u!4 &4194213612049569317 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4218093029747437941, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + m_PrefabInstance: {fileID: 53333245788890960} + m_PrefabAsset: {fileID: 0} +--- !u!4 &6191648371188871749 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6147515945576404245, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + m_PrefabInstance: {fileID: 53333245788890960} + m_PrefabAsset: {fileID: 0} +--- !u!4 &8997631150325690647 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8963143549970404935, guid: e4ee9e9425025a7409c3fbd040c04853, type: 3} + m_PrefabInstance: {fileID: 53333245788890960} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoArms.prefab.meta b/Packages/OctoCore/Runtime/Prefabs/OctoArms.prefab.meta new file mode 100644 index 00000000..d9746a79 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoArms.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 73480b78f75094a4da6b76dedb392ae9 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoCore.prefab b/Packages/OctoCore/Runtime/Prefabs/OctoCore.prefab new file mode 100644 index 00000000..0cc88866 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoCore.prefab @@ -0,0 +1,67 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &8589544845245727413 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6194350059673118374} + - component: {fileID: 4562949134636194362} + m_Layer: 0 + m_Name: OctoCore + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6194350059673118374 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8589544845245727413} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4562949134636194362 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8589544845245727413} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a699f971e869ebf46915f66af5dc8102, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OctoCore.OctoCore + Settings: {fileID: 11400000, guid: 1fc9111689f694145b60db4014028b18, type: 2} + _platform: + _current: 0 + _controller: 0 + _save: + Booleans: [] + Integers: [] + Floats: [] + Strings: [] + Vectors: [] + _inputs: + CurrentMap: 0 + ActionMaps: [] + _localization: + WrittenLanguage: 0 + AudioLanguage: 0 + _ui: + GlobalScale: 1 + ScreenSize: {x: 0, y: 0} + _development: + Log: 0 diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoCore.prefab.meta b/Packages/OctoCore/Runtime/Prefabs/OctoCore.prefab.meta new file mode 100644 index 00000000..27380b95 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoCore.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f413f8119a5cdd64c8656e6435b59b59 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoEvents.prefab b/Packages/OctoCore/Runtime/Prefabs/OctoEvents.prefab new file mode 100644 index 00000000..86098c18 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoEvents.prefab @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4347882179124040567 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 136799558801349280} + - component: {fileID: 6424964998645044441} + m_Layer: 0 + m_Name: OctoEvents + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &136799558801349280 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4347882179124040567} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6424964998645044441 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4347882179124040567} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 86cab3031ee84484985b55a4e37af012, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OctoCoreEvents + _onPlatformInitialized: + m_PersistentCalls: + m_Calls: [] + _onSaveInitialized: + m_PersistentCalls: + m_Calls: [] + _onInputsInitialized: + m_PersistentCalls: + m_Calls: [] + _onLocalizationInitialized: + m_PersistentCalls: + m_Calls: [] + _onUiInitialized: + m_PersistentCalls: + m_Calls: [] + _onOctoCoreInitialized: + m_PersistentCalls: + m_Calls: [] diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoEvents.prefab.meta b/Packages/OctoCore/Runtime/Prefabs/OctoEvents.prefab.meta new file mode 100644 index 00000000..df7a44d3 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoEvents.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5d08067eb94e2c34fb6b009ecd525a81 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoLink.prefab b/Packages/OctoCore/Runtime/Prefabs/OctoLink.prefab new file mode 100644 index 00000000..28017fe7 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoLink.prefab @@ -0,0 +1,47 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3352382525843710285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2854166076162324619} + - component: {fileID: 417140402366356801} + m_Layer: 0 + m_Name: OctoLink + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2854166076162324619 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3352382525843710285} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &417140402366356801 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3352382525843710285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aca1ddad5b073a9488d37617a5fd8d9a, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::OctoLink + _octoCore: {fileID: 8589544845245727413, guid: f3027fc87ba642145bb3792f69dcfb95, type: 3} diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoLink.prefab.meta b/Packages/OctoCore/Runtime/Prefabs/OctoLink.prefab.meta new file mode 100644 index 00000000..8e0d09d2 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoLink.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0c2f8ec75148b91418d31eba541cc81f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoPlayerFP.prefab b/Packages/OctoCore/Runtime/Prefabs/OctoPlayerFP.prefab new file mode 100644 index 00000000..d93a6840 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoPlayerFP.prefab @@ -0,0 +1,498 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2101508725665932610 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1836339402272228918} + - component: {fileID: 3666612565151794712} + - component: {fileID: 6053283114444666027} + - component: {fileID: 6989128982853398086} + m_Layer: 0 + m_Name: Camera Player + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1836339402272228918 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2101508725665932610} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.562, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8725966219179855439} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &3666612565151794712 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2101508725665932610} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.1 + far clip plane: 1000 + field of view: 80 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &6053283114444666027 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2101508725665932610} + m_Enabled: 1 +--- !u!114 &6989128982853398086 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2101508725665932610} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalCameraData + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!1 &8162540767767967414 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8725966219179855439} + - component: {fileID: 1735456339091181674} + - component: {fileID: 5295567073180248356} + m_Layer: 0 + m_Name: OctoPlayerFP + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8725966219179855439 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8162540767767967414} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1836339402272228918} + - {fileID: 2639365499984405449} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!143 &1735456339091181674 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8162540767767967414} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Height: 1.8 + m_Radius: 0.3 + m_SlopeLimit: 45 + m_StepOffset: 0.3 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0.001 + m_Center: {x: 0, y: 0.94, z: 0} +--- !u!114 &5295567073180248356 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8162540767767967414} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c85c0434d95406f4da8daa149ba90838, type: 3} + m_Name: + m_EditorClassIdentifier: OctoCore.Runtime::OctoCore.Components.OctoPlayer + _references: + Controller: {fileID: 1735456339091181674} + _settings: + Mode: 0 + Orientation: 1 + WalkSpeed: 10 + RunSpeed: 20 + JumpDuration: 0.4 + JumpHeight: 0.4 + Gravity: 9.8 + _mapping: + MoveAction: -560403583 + LookAction: -916633937 + RunAction: 1115268836 + JumpAction: -1877919292 + _firstPerson: + Camera: {fileID: 3666612565151794712} + SensitivityX: 0.1 + SensitivityY: 0.1 + MinPitch: -80 + MaxPitch: 80 +--- !u!1001 &2564566619627430770 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 8725966219179855439} + m_Modifications: + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 880987313172909187, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: _settings.LayerMask.m_Bits + value: 128 + objectReference: {fileID: 0} + - target: {fileID: 899615586671794689, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_Name + value: Arms + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.x + value: 0.1 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.y + value: -0.2685 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.z + value: 0.2737 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: -0.3780753 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.44424582 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: -0.5555247 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0.5925345 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 161.191 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -89.278015 + objectReference: {fileID: 0} + - target: {fileID: 905104535459292698, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 84.124 + objectReference: {fileID: 0} + - target: {fileID: 2656140929319940858, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 2656140929319940858, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: -0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 2656140929319940858, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10 + objectReference: {fileID: 0} + - target: {fileID: 2736084570026017097, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9961947 + objectReference: {fileID: 0} + - target: {fileID: 2736084570026017097, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.08715578 + objectReference: {fileID: 0} + - target: {fileID: 2736084570026017097, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.35385045 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.112266205 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.058453187 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0.92669815 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.655 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.451 + objectReference: {fileID: 0} + - target: {fileID: 3193146119612198720, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 137.992 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.11226625 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: -0.35385033 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.92669827 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: -0.05845286 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.655 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 165.549 + objectReference: {fileID: 0} + - target: {fileID: 4194213612049569317, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -42.008 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.x + value: -0.1 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.y + value: -0.2685 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalPosition.z + value: 0.2737 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.44424608 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.37807533 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.59253436 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0.5555246 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 198.809 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -90.721985 + objectReference: {fileID: 0} + - target: {fileID: 6729180175069464909, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -95.87601 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9622502 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.084186025 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: 0.25783423 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: -0.02255758 + objectReference: {fileID: 0} + - target: {fileID: 6868471396772723999, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9622502 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.x + value: 0.084186025 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.y + value: -0.25783414 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalRotation.z + value: 0.022557573 + objectReference: {fileID: 0} + - target: {fileID: 7939001859543297587, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -30 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} +--- !u!4 &2639365499984405449 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 520098895314436283, guid: 73480b78f75094a4da6b76dedb392ae9, type: 3} + m_PrefabInstance: {fileID: 2564566619627430770} + m_PrefabAsset: {fileID: 0} diff --git a/Packages/OctoCore/Runtime/Prefabs/OctoPlayerFP.prefab.meta b/Packages/OctoCore/Runtime/Prefabs/OctoPlayerFP.prefab.meta new file mode 100644 index 00000000..5a54b751 --- /dev/null +++ b/Packages/OctoCore/Runtime/Prefabs/OctoPlayerFP.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bfb9a06a57603714ca245d62fcd622f1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts.meta b/Packages/OctoCore/Runtime/Scripts.meta new file mode 100644 index 00000000..f04f6de6 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c4ad5e19e21e4074a9cd5f09c5c7fe24 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Components.meta b/Packages/OctoCore/Runtime/Scripts/Components.meta new file mode 100644 index 00000000..31a21976 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 63017153b92a8844fb10983e8151eb0d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoCharacterAnimation.cs b/Packages/OctoCore/Runtime/Scripts/Components/OctoCharacterAnimation.cs new file mode 100644 index 00000000..d5bd6775 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoCharacterAnimation.cs @@ -0,0 +1,101 @@ +using UnityEngine; + +namespace OctoCore.Components +{ +public class OctoCharacterAnimation : MonoBehaviour +{ + [SerializeField] private Animator animator; + [SerializeField] private float walkSpeed = 8; + [SerializeField] private float runSpeed = 15; + [SerializeField, Range(1, 10)] private int sampling = 5; + + private bool backward; + private float backwardSmooth; + private float sideSmooth; + private float smoothSpeed; + private Vector4[] positions; + private Vector3 lastStep; + private Vector3 direction; + + private float step = .1f; + + void OnDrawGizmos() + { + Gizmos.color = Color.cyan; + Gizmos.DrawRay(transform.position + Vector3.up, transform.forward); + + Gizmos.color = Color.red; + Gizmos.DrawRay(transform.position + Vector3.up, direction); + } + + void OnEnable() + { + positions = new Vector4[sampling + 1]; + for (int i = 0; i < sampling; i++) + { + positions[i] = transform.position; + positions[i].z = .002f; + } + + direction = transform.forward; + } + + void Update() + { + if (lastStep != transform.position && Vector3.Distance(lastStep, transform.position) > step) + { + Vector3 offset = (lastStep - transform.position).normalized * step; + lastStep = transform.position + offset; + } + + direction = Vector3.Lerp(direction, (transform.position - lastStep).normalized, Time.deltaTime * 10); + + float speed = GetSpeed(); + smoothSpeed = Mathf.Lerp(smoothSpeed, speed, Time.deltaTime * 10); + + float move = Mathf.Clamp01(smoothSpeed / walkSpeed); + float run = Mathf.Clamp01((smoothSpeed - walkSpeed) / (runSpeed - walkSpeed)); + + float dot = Vector3.Dot(transform.forward, direction.normalized); + Vector3 crs = Vector3.Cross(transform.forward, direction.normalized); + + backward = dot < 0; + backwardSmooth = Mathf.Lerp(backwardSmooth, backward ? 1 : 0, Time.deltaTime * 10); + + sideSmooth = Mathf.Lerp(sideSmooth, (1 - Mathf.Abs(dot)) * Mathf.Sign(transform.InverseTransformDirection(crs).y) * direction.magnitude, Time.deltaTime * 20); + + run *= 1 - backwardSmooth; + run *= 1 - Mathf.Abs(sideSmooth); + + //Debug.Log(dot); + + animator.SetFloat("move", Mathf.Sqrt(move)); + animator.SetFloat("run", run); + animator.SetFloat("backward", backwardSmooth); + animator.SetFloat("side", sideSmooth); + } + + float GetSpeed() + { + float offset = 0; + float delta = 0; + + for (int i = 0; i < positions.Length - 1; i++) + { + offset += Vector3.Distance(positions[i], positions[i + 1]); + delta += positions[i].w; + } + + for (int i = positions.Length - 1; i > 0; i--) + positions[i] = positions[i - 1]; + + positions[0] = transform.position; + positions[0].w = Time.deltaTime; + + if (offset > 0 && delta > 0) + return offset / (delta / 3.6f); + else return 0; + } +} + +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoCharacterAnimation.cs.meta b/Packages/OctoCore/Runtime/Scripts/Components/OctoCharacterAnimation.cs.meta new file mode 100644 index 00000000..8610d0e0 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoCharacterAnimation.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a4b0dbb024f42dc4c8c80d40a271d6d3 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoIkArms.cs b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkArms.cs new file mode 100644 index 00000000..d30203bf --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkArms.cs @@ -0,0 +1,205 @@ +using UnityEngine; +using static UnityEngine.GraphicsBuffer; + +public class OctoIkArms : MonoBehaviour +{ + private class RaycastInfos + { + public bool HasHit; + public float Distance; + public float MaxDistance; + public Vector3 Position; + public Vector3 Normal; + public Transform Transform; + } + + [System.Serializable] + private class RaycastRig + { + public Transform Root; + public float Distance = 1; + } + + [System.Serializable] + private class ArmRig + { + public bool Enabled; + public OctoIkLimb Arm; + public Vector3 RotationOffset; + public RaycastRig[] Raycasts; + + [HideInInspector] public Vector3 TargetOriginPos; + [HideInInspector] public Quaternion TargetOriginRot; + [HideInInspector] public Vector3 PoleOriginPos; + + public void Init() + { + if (Arm) + { + if (Arm.Target) + { + TargetOriginPos = Arm.Target.localPosition; + TargetOriginRot = Arm.Target.localRotation; + } + + if (Arm.Pole) + { + PoleOriginPos = Arm.Pole.localPosition; + } + } + } + } + + [System.Serializable] + private class Settings + { + public LayerMask LayerMask; + } + + [SerializeField] private ArmRig _leftArm; + [SerializeField] private ArmRig _rightArm; + [SerializeField] private Settings _settings; + + private ArmRig[] _arms; + private RaycastInfos[][] _raycasts = new RaycastInfos[2][]; + private RaycastInfos[] _nearHitRaycasts = new RaycastInfos[2]; + + void Awake() + { + _arms = new ArmRig[2] { _leftArm, _rightArm }; + foreach (ArmRig armRig in _arms) + armRig.Init(); + + _raycasts = new RaycastInfos[_arms.Length][]; + for (int i = 0; i < _arms.Length; i++) + { + _raycasts[i] = new RaycastInfos[_arms[i].Raycasts.Length]; + for (int u = 0; u < _raycasts[i].Length; u++) + _raycasts[i][u] = new RaycastInfos() { MaxDistance = 1 }; + } + + _nearHitRaycasts = new RaycastInfos[_arms.Length]; + for (int i = 0; i < _nearHitRaycasts.Length; i++) + _nearHitRaycasts[i] = new RaycastInfos() { MaxDistance = 1 }; + } + + void OnDrawGizmos()//Selected() + { + if (Application.isPlaying || !enabled) return; + + foreach (ArmRig armRig in new ArmRig[2] { _leftArm, _rightArm }) + { + for (int i = 0; i < armRig.Raycasts.Length; i++) + { + RaycastRig raycastRig = armRig.Raycasts[i]; + Debug.DrawRay(raycastRig.Root.position, raycastRig.Root.TransformDirection(Vector3.forward) * raycastRig.Distance, Color.red); + } + } + } + + void Update() + { + // Get raycats infos + + for (int i = 0; i < _arms.Length; i++) + { + ArmRig armRig = _arms[i]; + + if (!armRig.Enabled) + continue; + + for (int u = 0; u < armRig.Raycasts.Length; u++) + { + RaycastRig raycastRig = armRig.Raycasts[u]; + RaycastInfos raycastInfos = _raycasts[i][u]; + + RaycastHit hit; + + if (Physics.Raycast(raycastRig.Root.position, raycastRig.Root.TransformDirection(Vector3.forward), out hit, raycastRig.Distance, _settings.LayerMask)) + { + Debug.DrawRay(raycastRig.Root.position, raycastRig.Root.TransformDirection(Vector3.forward) * hit.distance, Color.green); + + raycastInfos.HasHit = true; + raycastInfos.Distance = hit.distance; + raycastInfos.MaxDistance = raycastRig.Distance; + raycastInfos.Position = hit.point; + raycastInfos.Normal = hit.normal; + raycastInfos.Transform = hit.transform; + } + else + { + Debug.DrawRay(raycastRig.Root.position, raycastRig.Root.TransformDirection(Vector3.forward) * raycastRig.Distance, Color.red); + + raycastInfos.HasHit = false; + raycastInfos.Distance = 1; + raycastInfos.MaxDistance = 1; + raycastInfos.Position = Vector3.zero; + raycastInfos.Normal = Vector3.zero; + raycastInfos.Transform = null; + } + } + } + + // Evaluate near hit + + for (int i = 0; i < _arms.Length; i++) + { + ArmRig armRig = _arms[i]; + _nearHitRaycasts[i].HasHit = false; + + for (int u = 0; u < armRig.Raycasts.Length; u++) + { + RaycastInfos raycastInfos = _raycasts[i][u]; + + if (raycastInfos.HasHit) + { + _nearHitRaycasts[i].HasHit = raycastInfos.HasHit; + _nearHitRaycasts[i].Distance = _raycasts[i][u].Distance; + _nearHitRaycasts[i].MaxDistance = _raycasts[i][u].MaxDistance; + _nearHitRaycasts[i].Position = _raycasts[i][u].Position; + _nearHitRaycasts[i].Normal = _raycasts[i][u].Normal; + _nearHitRaycasts[i].Transform = _raycasts[i][u].Transform; + + break; + } + } + } + + // Move hands + + for (int i = 0; i < _arms.Length; i++) + { + ArmRig armRig = _arms[i]; + RaycastInfos raycastInfos = _nearHitRaycasts[i]; + + Vector3 targetPos = armRig.TargetOriginPos; + Quaternion targetRot = armRig.TargetOriginRot; + + float sticknessPos = 0; + float sticknessRot = 0; + + if (raycastInfos.HasHit) + { + float doorForward = transform.InverseTransformDirection(raycastInfos.Transform.forward).z; + bool isGoodArm = i == 0 ? (doorForward < 0) : (doorForward > 0); + + if (isGoodArm) + { + targetPos = armRig.Arm.Target.parent.InverseTransformPoint(raycastInfos.Position); + targetRot = Quaternion.LookRotation(-armRig.Arm.Target.parent.InverseTransformDirection(raycastInfos.Normal), transform.up) * Quaternion.Euler(armRig.RotationOffset); + + float t = 1 - Mathf.Clamp01(raycastInfos.Distance / raycastInfos.MaxDistance); + + sticknessPos = Mathf.SmoothStep(0, .7f, t); + sticknessRot = Mathf.SmoothStep(.5f, .9f, t); + } + } + + float tPos = Mathf.SmoothStep(Time.deltaTime * 3, 1, sticknessPos); + float tRot = Mathf.SmoothStep(Time.deltaTime * 5, 1, sticknessRot); + + armRig.Arm.Target.localPosition = Vector3.Lerp(armRig.Arm.Target.localPosition, targetPos, tPos); + armRig.Arm.Target.localRotation = Quaternion.Lerp(armRig.Arm.Target.localRotation, targetRot, tRot); + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoIkArms.cs.meta b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkArms.cs.meta new file mode 100644 index 00000000..00e6b436 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkArms.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 015ed493fd8775f479bf25c92aa04e57 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoIkLimb.cs b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkLimb.cs new file mode 100644 index 00000000..718c05ba --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkLimb.cs @@ -0,0 +1,303 @@ +using UnityEngine; + +/// +/// Two-bone IK solver for a single limb (arm or leg). +/// Works with or without an Animator. +/// Assumes a 3-bone chain: start -> mid -> end. +/// Bones are assumed to point along a configurable local primary axis, +/// with a configurable local secondary axis used as "bend up". +/// +public class OctoIkLimb : MonoBehaviour +{ + public enum Axis + { + XPlus, + XMinus, + YPlus, + YMinus, + ZPlus, + ZMinus + } + + [System.Serializable] + private class Joints + { + [Tooltip("start joint of the limb (e.g. shoulder or hip).")] + public Transform Start; + + [Tooltip("Middle joint of the limb (e.g. elbow or knee).")] + public Transform Mid; + + [Tooltip("End joint of the limb (e.g. wrist or foot).")] + public Transform End; + } + + [System.Serializable] + private class Controllers + { + [Tooltip("Target the end joint should try to reach.")] + public Transform Target; + + [Tooltip("Optional pole to control the bending direction of the limb (e.g. elbow or knee direction).")] + public Transform Pole; + } + + [System.Serializable] + private class Settings + { + [Tooltip("Local primary axis pointing toward the next bone.")] + public Axis PrimaryAxis = Axis.YPlus; + + [Tooltip("Local secondary axis defining the bend 'up' direction.")] + public Axis SecondaryAxis = Axis.XMinus; + + [Header("Settings")] + + [Tooltip("Global IK blend weight (0 = no IK, 1 = full IK).")] + [Range(0f, 1f)] + public float Weight = 1; + + [Tooltip("Apply the target rotation to the end joint.")] + public bool OrientEnd = true; + } + + [System.Serializable] + private class VisualDebug + { + [Tooltip("Enable or disable IK debug gizmos.")] + public bool Gizmos = true; + + [Tooltip("Scale of the axis gizmos drawn at each joint.")] + public float Size = 0.1f; + } + + [SerializeField] private Joints _joints; + [SerializeField] private Controllers _controllers; + [SerializeField] private Settings _settings; + [SerializeField] private VisualDebug _debug; + + public Transform Target => _controllers.Target; + public Transform Pole => _controllers.Pole; + + private float _upperLength; + private float _lowerLength; + private float _maxReach; + + private Quaternion _axesCorrection = Quaternion.identity; + + +#if UNITY_EDITOR + void OnValidate() + { + RecalculateLengths(); + RecalculateAxesCorrection(); + } +#endif + + void Awake() + { + RecalculateLengths(); + RecalculateAxesCorrection(); + } + + void LateUpdate() + { + Solve(); + } + + /// + /// Recomputes bone lengths and max reach. + /// + private void RecalculateLengths() + { + if (_joints.Start && _joints.Mid && _joints.End) + { + _upperLength = Vector3.Distance(_joints.Start.position, _joints.Mid.position); + _lowerLength = Vector3.Distance(_joints.Mid.position, _joints.End.position); + _maxReach = Mathf.Max(0f, _upperLength + _lowerLength - 0.0001f); + } + } + + /// + /// Precomputes a local correction rotation so that: + /// - local primary axis is treated as +Z (forward) + /// - local secondary axis is treated as +Y (up) + /// + private void RecalculateAxesCorrection() + { + Vector3 pLocal = AxisToVector(_settings.PrimaryAxis).normalized; + Vector3 sLocal = AxisToVector(_settings.SecondaryAxis).normalized; + + // Step 1: rotate primary axis to +Z + Quaternion qPrimary = Quaternion.FromToRotation(pLocal, Vector3.forward); + + // Step 2: after this, rotate around Z so that secondary goes to +Y + Vector3 s1 = qPrimary * sLocal; + Vector3 s1Proj = Vector3.ProjectOnPlane(s1, Vector3.forward); + + if (s1Proj.sqrMagnitude < 0.000001f) + { + _axesCorrection = qPrimary; + return; + } + + s1Proj.Normalize(); + Quaternion qTwist = Quaternion.FromToRotation(s1Proj, Vector3.up); + + // This maps (primary, secondary) -> (Z+, Y+) + _axesCorrection = qTwist * qPrimary; + } + + /// + /// Solves IK for the current limb configuration. + /// Can be called manually if autoSolve is disabled. + /// + public void Solve() + { + if (_settings.Weight <= 0f) + return; + + if (!_joints.Start || !_joints.Mid || !_joints.End || !_controllers.Target) + return; + + if (_upperLength <= 0f || _lowerLength <= 0f) + RecalculateLengths(); + + Vector3 startPos = _joints.Start.position; + Vector3 midPos = _joints.Mid.position; + Vector3 endPos = _joints.End.position; + + Vector3 startToTarget = _controllers.Target.position - startPos; + float dist = startToTarget.magnitude; + if (dist < 0.0001f) + return; + + dist = Mathf.Min(dist, _maxReach); + Vector3 dirToTarget = startToTarget.normalized; + + Vector3 bendNormal; + + if (_controllers.Pole) + { + Vector3 startToPole = (_controllers.Pole.position - startPos); + Vector3 side = Vector3.ProjectOnPlane(startToPole, dirToTarget); + if (side.sqrMagnitude < 0.000001f) + { + // Fallback if pole is collinear with forward + side = Vector3.right; + } + side.Normalize(); + + // Bend normal is perpendicular to forward and to that side + bendNormal = Vector3.Cross(dirToTarget, side); + } + else + { + // Fallback: use start.up to define a side, then build a normal + Vector3 side = Vector3.ProjectOnPlane(_joints.Start.up, dirToTarget); + if (side.sqrMagnitude < 0.000001f) + side = Vector3.right; + side.Normalize(); + + bendNormal = Vector3.Cross(dirToTarget, side); + } + + if (bendNormal.sqrMagnitude < 0.000001f) + return; + + bendNormal.Normalize(); + + // Bend direction lies in the plane defined by dirToTarget and bendNormal + Vector3 bendDir = Vector3.Cross(bendNormal, dirToTarget).normalized; + + float a = _upperLength; + float b = _lowerLength; + float c = dist; + + // Law of cosines to compute start angle + float cos0 = Mathf.Clamp((a * a + c * c - b * b) / (2f * a * c), -1f, 1f); + float angle0 = Mathf.Acos(cos0); + + float along = Mathf.Cos(angle0) * a; + float height = Mathf.Sin(angle0) * a; + + Vector3 desiredMid = startPos + dirToTarget * along + bendDir * height; + Vector3 desiredEnd = _controllers.Target.position; + + // Canonical solver rotations assuming +Z forward, +Y up + Quaternion startVirtual = Quaternion.LookRotation(desiredMid - startPos, bendNormal); + Quaternion midVirtual = Quaternion.LookRotation(desiredEnd - desiredMid, bendNormal); + + // Map canonical frame to bone-local frame using axesCorrection + // (we expect bones to point along primaryAxis and bend using secondaryAxis) + Quaternion startDesired = startVirtual * _axesCorrection; + Quaternion midDesired = midVirtual * _axesCorrection; + + _joints.Start.rotation = Quaternion.Slerp(_joints.Start.rotation, startDesired, _settings.Weight); + _joints.Mid.rotation = Quaternion.Slerp(_joints.Mid.rotation, midDesired, _settings.Weight); + + if (_settings.OrientEnd) + { + _joints.End.rotation = Quaternion.Slerp(_joints.End.rotation, _controllers.Target.rotation, _settings.Weight); + } + } + + /// + /// Converts a LocalAxis6 enum to a unit Vector3. + /// + private Vector3 AxisToVector(Axis axis) + { + switch (axis) + { + default: return Vector3.forward; + case Axis.XPlus: return Vector3.right; + case Axis.XMinus: return Vector3.left; + case Axis.YPlus: return Vector3.up; + case Axis.YMinus: return Vector3.down; + case Axis.ZMinus: return Vector3.back; + } + } + + void OnDrawGizmos() + { + if (!_debug.Gizmos) + return; + + if (!_joints.Start || !_joints.Mid || !_joints.End) + return; + + // Bones to Controllers + Gizmos.color = Color.yellow; + if (_controllers.Target) + Gizmos.DrawLine(_joints.End.position, _controllers.Target.position); + if (_controllers.Pole) + Gizmos.DrawLine(_joints.Mid.position, _controllers.Pole.position); + + // Bones + Gizmos.color = Color.white; + Gizmos.DrawLine(_joints.Start.position, _joints.Mid.position); + Gizmos.DrawLine(_joints.Mid.position, _joints.End.position); + Gizmos.matrix = _joints.Start.localToWorldMatrix; + Gizmos.DrawWireSphere(Vector3.zero, _debug.Size * .15f); + Gizmos.matrix = _joints.Mid.localToWorldMatrix; + Gizmos.DrawWireSphere(Vector3.zero, _debug.Size * .15f); + Gizmos.matrix = _joints.End.localToWorldMatrix; + Gizmos.DrawWireSphere(Vector3.zero, _debug.Size * .15f); + + // Target + if (_controllers.Target) + { + Gizmos.color = Color.yellow; + Gizmos.matrix = _controllers.Target.localToWorldMatrix; + Gizmos.DrawWireCube(Vector3.zero, Vector3.one * _debug.Size); + } + + // Pole + if (_controllers.Pole) + { + Gizmos.color = Color.yellow; + Gizmos.matrix = _controllers.Pole.localToWorldMatrix; + Gizmos.DrawWireCube(Vector3.zero, Vector3.one * _debug.Size * .5f); + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoIkLimb.cs.meta b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkLimb.cs.meta new file mode 100644 index 00000000..0128053f --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkLimb.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f5a9786856021274fbe10be8b0cef721 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoIkRaycast.cs b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkRaycast.cs new file mode 100644 index 00000000..8f2f4fd5 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkRaycast.cs @@ -0,0 +1,49 @@ +using UnityEngine; + +public class OctoIkRaycast : MonoBehaviour +{ + public float _distance = 1; + public Vector3 rotationOffset; + public Transform _target; + public LayerMask _layerMask; + + Vector3 originPos; + Vector3 targetPos; + Quaternion originRot; + Quaternion targetRot; + + void Start() + { + originPos = targetPos = _target.localPosition; + originRot = targetRot = _target.localRotation; + } + + void Update() + { + float deltaPos = Time.deltaTime * 3f; + float deltaRot = Time.deltaTime * 3f; + + RaycastHit hit; + + if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, _distance, _layerMask)) + { + Debug.DrawRay(transform.position, transform.TransformDirection(Vector3.forward) * hit.distance, Color.yellow); + + targetPos = transform.InverseTransformPoint(hit.point); + targetRot = Quaternion.LookRotation(-transform.InverseTransformDirection(hit.normal), transform.up) * Quaternion.Euler(rotationOffset); + + deltaPos = Mathf.Lerp(1, deltaPos, Mathf.Clamp01(hit.distance / _distance)); + deltaRot = Mathf.Lerp(.1f, deltaRot, Mathf.Clamp01(hit.distance / _distance)); + } + else + { + Debug.DrawRay(transform.position, transform.TransformDirection(Vector3.forward) * _distance, Color.white); + + targetPos = originPos; + targetRot = originRot; + } + + _target.localPosition = Vector3.Lerp(_target.localPosition, targetPos, deltaPos); + _target.localRotation = Quaternion.Lerp(_target.localRotation, targetRot, deltaRot); + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoIkRaycast.cs.meta b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkRaycast.cs.meta new file mode 100644 index 00000000..0b7afefb --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoIkRaycast.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 99a9ae539a68f554cbab92ca6eb4e7e5 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoLink.cs b/Packages/OctoCore/Runtime/Scripts/Components/OctoLink.cs new file mode 100644 index 00000000..86845695 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoLink.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace OctoCore +{ + [DefaultExecutionOrder(-102)] + public class OctoLink : MonoBehaviour + { + [SerializeField] Object _octoCore; + + void Awake() + { + if (!OctoCore.Instance && _octoCore) + Instantiate(_octoCore); + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoLink.cs.meta b/Packages/OctoCore/Runtime/Scripts/Components/OctoLink.cs.meta new file mode 100644 index 00000000..cb53f28d --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoLink.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: aca1ddad5b073a9488d37617a5fd8d9a \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoPlayer.cs b/Packages/OctoCore/Runtime/Scripts/Components/OctoPlayer.cs new file mode 100644 index 00000000..3e92de7b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoPlayer.cs @@ -0,0 +1,297 @@ +using OctoCore.Inputs; +using UnityEngine; + +namespace OctoCore.Components +{ + public class OctoPlayer : MonoBehaviour + { + public static OctoPlayer Instance { get; private set; } + + public enum PlayerModes { FirstPerson, ThirdPerson } + public enum Orientations { World, Camera } + + [System.Serializable] + private class References + { + public CharacterController Controller; + } + + [System.Serializable] + private class Settings + { + public PlayerModes Mode = PlayerModes.FirstPerson; + public Orientations Orientation = Orientations.Camera; + + [Tooltip("Walk speed (km/h).")] + public float WalkSpeed = 10; + + [Tooltip("Run speed (km/h).")] + public float RunSpeed = 20; + + [Tooltip("Jump duration (seconds).")] + public float JumpDuration = .4f; + + [Tooltip("Maximum jump height reached at the apex (meters).")] + public float JumpHeight = .4f; + + [Tooltip("Downward acceleration applied to the player (m/s²).")] + public float Gravity = 9.8f; + } + + [System.Serializable] + private class Mapping + { + public OctoActions MoveAction; + public OctoActions LookAction; + public OctoActions RunAction; + public OctoActions JumpAction; + } + + [System.Serializable] + private class FirstPerson + { + [Header("References")] + + public Camera Camera; + + [Header("Settings")] + + [Tooltip("Horizontal sensitivity (Yaw).")] + public float SensitivityX = 0.1f; + + [Tooltip("Vertical sensitivity (Pitch).")] + public float SensitivityY = 0.1f; + + [Tooltip("Minimum pitch (looking down).")] + public float MinPitch = -80f; + + [Tooltip("Maximum pitch (looking up).")] + public float MaxPitch = 80f; + } + + [SerializeField] private References _references; + [SerializeField] private Settings _settings; + [SerializeField] private Mapping _mapping; + [SerializeField] private FirstPerson _firstPerson; + + private bool _isPaused; + private bool _jumpInput; + private bool _jumpping; + private bool _runInput; + private float _runInertia; + private float _yaw; + private float _pitch; + private float _jumpLerp; + private float _jumpTime; + private float _jumpAltitude; + private Vector2 _moveInput; + private Vector2 _lookInput; + private Vector3 _moveInertia; + private Vector3 _moveDirection; + + public bool IsPaused => _isPaused; + public float Radius => _references.Controller ? _references.Controller.radius : 0; + + void OnEnable() + { + if (!Instance) Instance = this; + else Destroy(gameObject); + + OctoCore.Instance.Inputs.SubscribeAction(_mapping.MoveAction, Move); + OctoCore.Instance.Inputs.SubscribeAction(_mapping.LookAction, Look); + OctoCore.Instance.Inputs.SubscribeAction(_mapping.RunAction, Run); + OctoCore.Instance.Inputs.SubscribeAction(_mapping.JumpAction, Jump); + + _yaw = transform.eulerAngles.y; + + Pause(_isPaused); + } + + void OnDisable() + { + OctoCore.Instance.Inputs.UnsubscribeAction(_mapping.MoveAction, Move); + OctoCore.Instance.Inputs.UnsubscribeAction(_mapping.RunAction, Run); + OctoCore.Instance.Inputs.UnsubscribeAction(_mapping.JumpAction, Jump); + + if (Instance == this) Instance = null; + } + + void Update() + { + _moveInput = _isPaused ? Vector2.zero : Vector2.ClampMagnitude(_moveInput, 1); + Camera cam = (_firstPerson.Camera && _firstPerson.Camera.enabled && _firstPerson.Camera.gameObject.activeInHierarchy) ? _firstPerson.Camera : Camera.main; + + bool accelerating = _moveInput.magnitude > .1f; + bool isGrounded = _references.Controller ? _references.Controller.isGrounded : true; + float t = Time.deltaTime / 3.6f; + + // Move + + Vector3 move = new Vector3(_moveInput.x, 0, _moveInput.y); + + if (_settings.Orientation == Orientations.Camera && cam) + { + Vector3 camForward = cam.transform.forward; + camForward.y = 0; + camForward.Normalize(); + + Vector3 camRight = cam.transform.right; + camRight.y = 0; + camRight.Normalize(); + + move = camRight * move.x + camForward * move.z; + } + + float deltaSmooth = t * (accelerating ? 30 : 15); + _moveDirection = Vector3.Lerp(_moveDirection, move, deltaSmooth * 1.5f); + + deltaSmooth *= 1 - Vector3.Cross(_moveInertia, _moveDirection).magnitude; + _moveInertia = Vector3.Lerp(_moveInertia, move, deltaSmooth); + + if (!accelerating && _moveInertia.magnitude < .01f) _moveInertia = Vector3.zero; + + _runInertia = Mathf.Lerp(_runInertia, _runInput ? 1 : 0, t * (accelerating ? 5 : 3)); + + Vector3 moveDelta = _moveInertia * t * Mathf.Lerp(_settings.WalkSpeed, _settings.RunSpeed, _runInertia); + + if (isGrounded && _jumpInput && !_jumpping) + { + _jumpInput = false; + _jumpping = true; + _jumpLerp = 0; + _jumpTime = Time.timeSinceLevelLoad; + _jumpAltitude = transform.position.y; + } + + float jumpOffset = 0; + + if (_jumpping) + { + _jumpLerp = (Time.timeSinceLevelLoad - _jumpTime) / _settings.JumpDuration; + + if (_jumpLerp >= 1 || (_jumpLerp > .3f && isGrounded)) + { + _jumpping = false; + _jumpLerp = 0; + } + else + { + float x = _jumpLerp; + x = x * 2 - 1f; + + float y; + if (x < 0) y = Mathf.Sqrt(1f - x * x); + else y = Mathf.Cos(x * .5f * Mathf.PI); + y = _jumpAltitude + y * _settings.JumpHeight; + + jumpOffset = y - transform.position.y; + } + } + + if (_jumpping) + moveDelta.y = jumpOffset; + else + moveDelta.y -= _settings.Gravity * Time.deltaTime; + + if (_references.Controller) + _references.Controller.Move(moveDelta); + else + transform.position += moveDelta; + + // Rotate + + switch (_settings.Mode) + { + case PlayerModes.FirstPerson: + if (cam && !_isPaused) + { + Vector2 delta = _lookInput; + + float mouseX = delta.x * _firstPerson.SensitivityX; + float mouseY = delta.y * _firstPerson.SensitivityY * -1; + + _yaw += mouseX; + _pitch = Mathf.Clamp(_pitch + mouseY, _firstPerson.MinPitch, _firstPerson.MaxPitch); + + transform.rotation = Quaternion.Euler(0, _yaw, 0); + cam.transform.localRotation = Quaternion.Euler(_pitch, 0, 0); + } + break; + + case PlayerModes.ThirdPerson: + { + Quaternion targetRot = transform.rotation; + if (_moveInertia.magnitude > .002f) + { + Vector3 offset = _moveInertia - _moveDirection; + offset *= _moveInertia.magnitude * _runInertia; + offset = Vector3.ClampMagnitude(offset * 1f, 1f); + Vector3 up = (Vector3.up - offset).normalized; + Quaternion lookRot = Quaternion.LookRotation(_moveInertia, up); + targetRot = Quaternion.Lerp(targetRot, lookRot, t * 30); + } + transform.rotation = targetRot; + break; + } + } + + // Reset + + _moveInput = Vector2.zero; + _lookInput = Vector2.zero; + _runInput = false; + } + + public void Teleport(Vector3 position, Quaternion rotation) + { + _isPaused = _jumpInput = _jumpping = _runInput = false; + _runInertia = _jumpLerp = _jumpTime = _jumpAltitude = 0; + _moveInput = _lookInput = Vector2.zero; + _moveInertia = _moveDirection = Vector3.zero; + _yaw = rotation.eulerAngles.y; + _pitch = 0; + + if (_references.Controller) + _references.Controller.enabled = false; + + transform.position = position; + transform.rotation = rotation; + + if (_references.Controller) + _references.Controller.enabled = true; + } + + public void Pause(bool pause) + { + _isPaused = pause; + + if (OctoCore.Instance) + OctoCore.Instance.UI.SetCursor(); + } + + private void Move(Vector2 value) { _moveInput = value; } + private void Look(Vector2 value) { _lookInput = value; } + private void Run() { _runInput = true; } + private void Jump() { _jumpInput = true; } + + private void SetMode() + { + switch (_settings.Mode) + { + case PlayerModes.FirstPerson: + // Activate First Person Camera + break; + + case PlayerModes.ThirdPerson: + // Activate Third Person Camera + break; + } + } + + /*public static float Arc(float x) + { + x = Mathf.Clamp01(x) * 2 - 1f; + return Mathf.Sqrt(1f - x * x); + }*/ + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoPlayer.cs.meta b/Packages/OctoCore/Runtime/Scripts/Components/OctoPlayer.cs.meta new file mode 100644 index 00000000..b8986bfe --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoPlayer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c85c0434d95406f4da8daa149ba90838 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveEvent.cs b/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveEvent.cs new file mode 100644 index 00000000..9b5f1d48 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveEvent.cs @@ -0,0 +1,194 @@ +using System; +using UnityEngine; +using UnityEngine.Events; +using OctoCore.Save.Data; + +namespace OctoCore.Components +{ +public class OctoSaveEvent : MonoBehaviour +{ + [SerializeField] private OctoData data; + + [SerializeField] private bool invertValue; + + [SerializeField] private UnityEvent onInitBool; + [SerializeField] private UnityEvent onInitInt; + [SerializeField] private UnityEvent onInitFloat; + [SerializeField] private UnityEvent onInitString; + [SerializeField] private UnityEvent onInitVector; + + [SerializeField] private UnityEvent onChangeBool; + [SerializeField] private UnityEvent onChangeInt; + [SerializeField] private UnityEvent onChangeFloat; + [SerializeField] private UnityEvent onChangeString; + [SerializeField] private UnityEvent onChangeVector; + + private Action onValueChangedBool; + private Action onValueChangedInt; + private Action onValueChangedFloat; + private Action onValueChangedString; + private Action onValueChangedVector; + + void OnEnable() + { + if (!OctoCore.Instance) return; + + if (data) + { + switch (data) + { + case global::OctoCore.Save.Data.OctoDataBool: + OnValueInit(OctoCore.Instance.Save.GetBool(data.Id)); + OctoCore.Instance.Save.Subscribe(data, onValueChangedBool = OnValueChanged); + break; + + case global::OctoCore.Save.Data.OctoDataInt: + OnValueInit(OctoCore.Instance.Save.GetInt(data.Id)); + OctoCore.Instance.Save.Subscribe(data, onValueChangedInt = OnValueChanged); + break; + + case global::OctoCore.Save.Data.OctoDataFloat: + OnValueInit(OctoCore.Instance.Save.GetFloat(data.Id)); + OctoCore.Instance.Save.Subscribe(data, onValueChangedFloat = OnValueChanged); + break; + + case global::OctoCore.Save.Data.OctoDataString: + OnValueInit(OctoCore.Instance.Save.GetString(data.Id)); + OctoCore.Instance.Save.Subscribe(data, onValueChangedString = OnValueChanged); + break; + + case global::OctoCore.Save.Data.OctoDataVector: + OnValueInit(OctoCore.Instance.Save.GetVector(data.Id)); + OctoCore.Instance.Save.Subscribe(data, onValueChangedVector = OnValueChanged); + break; + + default: + if (OctoCore.Instance.Development.Log) + Debug.Log($"Unsupported data: {data.Id}"); + break; + } + + if (OctoCore.Instance.Development.Log && data) + Debug.Log($"{name} subscribed on: {data.Id}"); + } + else if (OctoCore.Instance.Development.Log && data) + { + Debug.Log($"Data is null"); + } + } + + void OnDisable() + { + if (!OctoCore.Instance) return; + + if (data) + { + if (onValueChangedBool != null) + { + OctoCore.Instance.Save.Unsubscribe(data, onValueChangedBool); + onValueChangedBool = null; + } + + if (onValueChangedInt != null) + { + OctoCore.Instance.Save.Unsubscribe(data, onValueChangedInt); + onValueChangedInt = null; + } + + if (onValueChangedFloat != null) + { + OctoCore.Instance.Save.Unsubscribe(data, onValueChangedFloat); + onValueChangedFloat = null; + } + + if (onValueChangedString != null) + { + OctoCore.Instance.Save.Unsubscribe(data, onValueChangedString); + onValueChangedString = null; + } + + if (onValueChangedVector != null) + { + OctoCore.Instance.Save.Unsubscribe(data, onValueChangedVector); + onValueChangedVector = null; + } + + if (OctoCore.Instance.Development.Log && data) + Debug.Log($"{name} unsubscribed on: {data.Id}"); + } + } + + void OnValueInit() + { + if (OctoCore.Instance.Development.Log && data) + Debug.Log($"Value initialized on: {data.Id}"); + } + + void OnValueInit(bool value) + { + onInitBool?.Invoke(invertValue ? !value : value); + OnValueInit(); + } + + void OnValueInit(int value) + { + onInitInt?.Invoke(value); + OnValueChanged(); + } + + void OnValueInit(float value) + { + onInitFloat?.Invoke(value); + OnValueChanged(); + } + + void OnValueInit(string value) + { + onInitString?.Invoke(value); + OnValueChanged(); + } + + void OnValueInit(Vector4 value) + { + onInitVector?.Invoke(value); + OnValueInit(); + } + + void OnValueChanged() + { + if (OctoCore.Instance.Development.Log && data) + Debug.Log($"Value changed on: {data.Id}"); + } + + void OnValueChanged(bool value) + { + onChangeBool?.Invoke(invertValue ? !value : value); + OnValueChanged(); + } + + void OnValueChanged(int value) + { + onChangeInt?.Invoke(value); + OnValueChanged(); + } + + void OnValueChanged(float value) + { + onChangeFloat?.Invoke(value); + OnValueChanged(); + } + + void OnValueChanged(string value) + { + onChangeString?.Invoke(value); + OnValueChanged(); + } + + void OnValueChanged(Vector4 value) + { + onChangeVector?.Invoke(value); + OnValueChanged(); + } +} + +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveEvent.cs.meta b/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveEvent.cs.meta new file mode 100644 index 00000000..b0afa1a7 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveEvent.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2978f4ffc9fdd0f4387d6b5e41746646 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveProxy.cs b/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveProxy.cs new file mode 100644 index 00000000..9d473b88 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveProxy.cs @@ -0,0 +1,42 @@ +using UnityEngine; +using OctoCore.Save.Data; + +namespace OctoCore.Components +{ +public class OctoSaveProxy : MonoBehaviour +{ + [SerializeField] private OctoData data; + + public void SetData(OctoData data) + { + this.data = data; + } + + public void SetBool(bool value) + { + if (OctoCore.Instance) + OctoCore.Instance.Save.Set(data as global::OctoCore.Save.Data.OctoDataBool, value); + } + public void SetInt(int value) + { + if (OctoCore.Instance) + OctoCore.Instance.Save.Set(data as global::OctoCore.Save.Data.OctoDataInt, value); + } + public void SetFloat(float value) + { + if (OctoCore.Instance) + OctoCore.Instance.Save.Set(data as global::OctoCore.Save.Data.OctoDataFloat, value); + } + public void SetString(string value) + { + if (OctoCore.Instance) + OctoCore.Instance.Save.Set(data as global::OctoCore.Save.Data.OctoDataString, value); + } + public void SetVector(Vector4 value) + { + if (OctoCore.Instance) + OctoCore.Instance.Save.Set(data as global::OctoCore.Save.Data.OctoDataVector, value); + } +} + +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveProxy.cs.meta b/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveProxy.cs.meta new file mode 100644 index 00000000..d86cb4aa --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoSaveProxy.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c1b0281cf6e469a43ad8ef7171913dad \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoWorldEvent.cs b/Packages/OctoCore/Runtime/Scripts/Components/OctoWorldEvent.cs new file mode 100644 index 00000000..4ebdd964 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoWorldEvent.cs @@ -0,0 +1,201 @@ +using OctoCore.Inputs; +using OctoCore.Utilities; +using System; +using System.Linq; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.InputSystem; + +namespace OctoCore.Components +{ + public class OctoWorldEvent : MonoBehaviour + { + public enum Conditions { None, Player, Tags, Targets } + + //[SerializeField] private InputActionAsset _actionAsset; + //[SerializeField] private InputActionReference _actionReference; + //[Space(10)] + + [SerializeField] private Utilities.OctoEvents _trigger; + [SerializeField] private OctoActions _action; + [SerializeField] private Conditions _condition; + [SerializeField] private string[] _tags; + [SerializeField] private GameObject[] _targets; + [SerializeField] private UnityEvent _onTrigger; + + private bool _playerInside; + private bool[] _tagsInside; + private bool[] _targetsInside; + + private const string PlayerTag = "Player"; + + void Awake() + { + _tagsInside = new bool[_tags.Length]; + _targetsInside = new bool[_targets.Length]; + + switch (_trigger) + { + case Utilities.OctoEvents.Awake: + SetTrigger(); + break; + + case Utilities.OctoEvents.Action: + OctoCore.Instance.Inputs.SubscribeAction(_action, SetTrigger); + break; + } + } + + void OnEnable() + { + if (_trigger == Utilities.OctoEvents.OnEnable) + SetTrigger(); + } + + void Start() + { + if (_trigger == Utilities.OctoEvents.Start) + SetTrigger(); + } + + void Update() + { + if (_trigger == Utilities.OctoEvents.Update) + SetTrigger(); + } + + void LateUpdate() + { + if (_trigger == Utilities.OctoEvents.LateUpdate) + SetTrigger(); + } + + void FixedUpdate() + { + if (_trigger == Utilities.OctoEvents.FixedUpdate) + SetTrigger(); + } + void OnDisable() + { + if (_trigger == Utilities.OctoEvents.OnDisable) + SetTrigger(); + + _playerInside = false; + _tagsInside = new bool[_tags.Length]; + _targetsInside = new bool[_targets.Length]; + } + + void OnDestroy() + { + switch (_trigger) + { + case Utilities.OctoEvents.OnDestroy: + SetTrigger(); + break; + + case Utilities.OctoEvents.Action: + OctoCore.Instance?.Inputs.UnsubscribeAction(_action, SetTrigger); + break; + } + } + + void OnTriggerEnter(Collider col) + { + if (_trigger == Utilities.OctoEvents.OnTriggerEnter) + { + EvaluateTrigger(col); + SetTrigger(); + } + } + + void OnTriggerStay(Collider col) + { + EvaluateTrigger(col); + if (_trigger == Utilities.OctoEvents.OnTriggerStay) + SetTrigger(); + } + + void OnTriggerExit(Collider col) + { + if (_trigger == Utilities.OctoEvents.OnTriggerExit) + SetTrigger(); + EvaluateTrigger(col, false); + } + + public void SetTrigger() + { + switch (_condition) + { + case Conditions.None: + _onTrigger?.Invoke(); + break; + + case Conditions.Player: + if (_playerInside) + _onTrigger?.Invoke(); + break; + + case Conditions.Tags: + for (int i = 0; i < _tagsInside.Length; i++) + { + if (_tagsInside[i]) + { + _onTrigger?.Invoke(); + break; + } + } + break; + + case Conditions.Targets: + for (int i = 0; i < _targetsInside.Length; i++) + { + if (_targetsInside[i]) + { + _onTrigger?.Invoke(); + break; + } + } + break; + } + } + + void EvaluateTrigger(Collider col, bool inside = true) + { + switch (_condition) + { + case Conditions.Player: + if (col.tag == PlayerTag) + _playerInside = inside; + break; + + case Conditions.Tags: + if (_tags.Contains(col.tag)) + { + for (int i = 0; i < _tags.Length; i++) + { + bool tagMatch = col.tag == _tags[i]; + if (tagMatch) + { + _tagsInside[i] = inside ? tagMatch : !tagMatch; + } + } + } + break; + + case Conditions.Targets: + if (_targets.Contains(col.gameObject)) + { + for (int i = 0; i < _targets.Length; i++) + { + bool targetMatch = col.gameObject == _targets[i]; + if (targetMatch) + { + _targetsInside[i] = inside ? targetMatch : !targetMatch; + } + } + } + break; + } + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Components/OctoWorldEvent.cs.meta b/Packages/OctoCore/Runtime/Scripts/Components/OctoWorldEvent.cs.meta new file mode 100644 index 00000000..184a5987 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Components/OctoWorldEvent.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5170627695bd877419928fa9ca37865d \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Development.meta b/Packages/OctoCore/Runtime/Scripts/Development.meta new file mode 100644 index 00000000..5231a98d --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Development.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 086b0be20b6bc5e42b2fe80f2ce8e863 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Development/OctoDevelopment.cs b/Packages/OctoCore/Runtime/Scripts/Development/OctoDevelopment.cs new file mode 100644 index 00000000..115877a8 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Development/OctoDevelopment.cs @@ -0,0 +1,37 @@ +using UnityEngine.SceneManagement; + +namespace OctoCore.Development +{ + /// + /// Development and debugging module. + /// Provides settings for in-game logging. + /// + [System.Serializable] + public class OctoDevelopment : IOctoModule + { + /// + /// Whether to enable debug logging throughout the framework. + /// + public bool Log; + + public void Init(OctoSettings settings) + { + + } + + public void Tick() + { + + } + + public void OnSceneChanged(Scene current, Scene next) + { + + } + + public void OnQuit() + { + + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Development/OctoDevelopment.cs.meta b/Packages/OctoCore/Runtime/Scripts/Development/OctoDevelopment.cs.meta new file mode 100644 index 00000000..1d7f5076 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Development/OctoDevelopment.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 21618ec4511f27a43975352bde789bb6 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue.meta new file mode 100644 index 00000000..cb44484c --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e051aab1fc4e4e243b307fd7f0b0756f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Components.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components.meta new file mode 100644 index 00000000..f3448bd1 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1be27ce87e441a545bd6f3fdd3c18b61 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueEvent.cs b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueEvent.cs new file mode 100644 index 00000000..15392c5b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueEvent.cs @@ -0,0 +1,65 @@ +using UnityEngine; +using UnityEngine.Events; + +namespace OctoCore.Dialogue.Components +{ + /// + /// Component to trigger dialogue events. + /// Listens to dialogue start/end and invokes UnityEvents. + /// + public class OctoDialogueEvent : MonoBehaviour + { + [SerializeField, Tooltip("Dialogue data to listen for")] + private Data.OctoDialogueData _dialogue; + + [SerializeField, Tooltip("Called when the specified dialogue starts")] + private UnityEvent _onDialogueStarted; + + [SerializeField, Tooltip("Called when the specified dialogue ends")] + private UnityEvent _onDialogueEnded; + + void OnEnable() + { + if (OctoDialogueManager.Instance != null) + { + // Subscribe to manager events + OctoDialogueManager.Instance.GetComponent() + ._events.OnDialogueStarted.AddListener(OnDialogueStarted); + OctoDialogueManager.Instance.GetComponent() + ._events.OnDialogueEnded.AddListener(OnDialogueEnded); + } + } + + void OnDisable() + { + if (OctoDialogueManager.Instance != null) + { + // Unsubscribe from manager events + OctoDialogueManager.Instance.GetComponent() + ._events.OnDialogueStarted.RemoveListener(OnDialogueStarted); + OctoDialogueManager.Instance.GetComponent() + ._events.OnDialogueEnded.RemoveListener(OnDialogueEnded); + } + } + + private void OnDialogueStarted() + { + if (OctoDialogueManager.Instance == null) + return; + + var currentDialogue = OctoDialogueManager.Instance.GetCurrentDialogue(); + if (currentDialogue == _dialogue) + { + _onDialogueStarted?.Invoke(); + } + } + + private void OnDialogueEnded() + { + // Dialogue already ended, so we check if it was our dialogue + // Note: This might not work perfectly if dialogue changes rapidly + // A better implementation would track the last active dialogue + _onDialogueEnded?.Invoke(); + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueEvent.cs.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueEvent.cs.meta new file mode 100644 index 00000000..f497d354 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueEvent.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a7c573c7064e10f4ba4855e8f448ee81 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueManager.cs b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueManager.cs new file mode 100644 index 00000000..797e6727 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueManager.cs @@ -0,0 +1,291 @@ +using System.Collections.Generic; +using TMPro; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.UI; +using OctoCore.Localization; +using OctoCore.Components; + +namespace OctoCore.Dialogue.Components +{ + /// + /// Dialogue manager component. + /// Singleton that handles dialogue display and flow. + /// Uses UI Text components if assigned, otherwise falls back to GUI. + /// + public class OctoDialogueManager : MonoBehaviour + { + /// + /// Singleton instance. + /// + public static OctoDialogueManager Instance { get; private set; } + + /// + /// References to UI components. + /// + [System.Serializable] + public class References + { + [Tooltip("Legacy UI Text component (optional)")] + public Text Text; + + [Tooltip("TextMeshPro component (optional)")] + public TextMeshPro TextMeshPro; + + [Tooltip("TextMeshPro UGUI component (optional)")] + public TextMeshProUGUI TextMeshProUGUI; + } + + /// + /// Dialogue events. + /// + [System.Serializable] + public class Events + { + [Tooltip("Called when a dialogue starts")] + public UnityEvent OnDialogueStarted; + + [Tooltip("Called when a new entry starts displaying")] + public UnityEvent OnEntryStarted; + + [Tooltip("Called when a choice is selected")] + public UnityEvent OnChoiceSelected; + + [Tooltip("Called when a dialogue ends")] + public UnityEvent OnDialogueEnded; + } + + [SerializeField] private References _references; + [SerializeField] public Events _events; + + private Data.OctoDialogueData _currentDialogue; + private int _currentEntryIndex; + private List _availableChoices = new List(); + private bool _isActive; + + void Awake() + { + if (Instance == null) + { + Instance = this; + } + else + { + Destroy(gameObject); + } + } + + void OnDestroy() + { + if (Instance == this) + { + Instance = null; + } + } + + /// + /// Start a new dialogue. + /// Automatically displays the first entry. + /// + public void StartDialogue(Data.OctoDialogueData dialogue) + { + if (dialogue == null || dialogue.Entries == null || dialogue.Entries.Length == 0) + { + Debug.LogWarning("[OctoDialogueManager] Cannot start dialogue: null or empty"); + return; + } + + _currentDialogue = dialogue; + _currentEntryIndex = 0; + _isActive = true; + + _events.OnDialogueStarted?.Invoke(); + if (OctoPlayer.Instance) OctoPlayer.Instance.Pause(true); // TMP + DisplayCurrentEntry(); + } + + /// + /// Display the current dialogue entry. + /// + private void DisplayCurrentEntry() + { + if (_currentDialogue == null || _currentEntryIndex >= _currentDialogue.Entries.Length) + { + EndDialogue(); + return; + } + + OctoDialogueEntry entry = _currentDialogue.Entries[_currentEntryIndex]; + + _events.OnEntryStarted?.Invoke(); + + // Display text + string text = OctoLocalization.GetLocalizedText(entry.Text); + SetText(text); + + // Build available choices + _availableChoices.Clear(); + if (entry.Choices != null) + { + foreach (var choice in entry.Choices) + { + if (choice.IsAvailable()) + { + _availableChoices.Add(choice); + } + } + } + } + + /// + /// Select a choice by index. + /// + public void SelectChoice(int choiceIndex) + { + if (!_isActive || choiceIndex < 0 || choiceIndex >= _availableChoices.Count) + return; + + OctoDialogueChoice choice = _availableChoices[choiceIndex]; + + _events.OnChoiceSelected?.Invoke(); + + if (choice.NextDialogue != null) + { + StartDialogue(choice.NextDialogue); + } + else + { + EndDialogue(); + } + } + + /// + /// Continue to next entry (when no choices available). + /// + public void Continue() + { + if (!_isActive) + return; + + if (_availableChoices.Count == 0) + { + _currentEntryIndex++; + DisplayCurrentEntry(); + } + } + + /// + /// End the current dialogue. + /// + private void EndDialogue() + { + _isActive = false; + _currentDialogue = null; + _currentEntryIndex = 0; + _availableChoices.Clear(); + + if (OctoPlayer.Instance) OctoPlayer.Instance.Pause(false); // TMP + _events.OnDialogueEnded?.Invoke(); + } + + /// + /// Set text using available UI component or GUI fallback. + /// + private void SetText(string text) + { + if (_references.Text != null) + { + _references.Text.text = text; + } + else if (_references.TextMeshPro != null) + { + _references.TextMeshPro.text = text; + } + else if (_references.TextMeshProUGUI != null) + { + _references.TextMeshProUGUI.text = text; + } + // GUI fallback handled in OnGUI + } + + void OnGUI() + { + // Only use GUI if no text component is assigned + if (_references.Text != null || _references.TextMeshPro != null || _references.TextMeshProUGUI != null) + return; + + if (!_isActive || _currentDialogue == null) + return; + + if (_currentEntryIndex >= _currentDialogue.Entries.Length) + return; + + OctoDialogueEntry entry = _currentDialogue.Entries[_currentEntryIndex]; + + GUILayout.BeginArea(new Rect(50, Screen.height - 200, Screen.width - 100, 150)); + GUILayout.Box("", GUILayout.Width(Screen.width - 100), GUILayout.Height(150)); + + GUILayout.BeginArea(new Rect(10, 10, Screen.width - 120, 130)); + + // Speaker name + if (entry.Speaker != null && entry.Speaker.Name != null) + { + string speakerName = OctoLocalization.GetLocalizedText(entry.Speaker.Name); + GUILayout.Label(speakerName, GUI.skin.box); + } + + // Dialogue text + string text = OctoLocalization.GetLocalizedText(entry.Text); + GUILayout.Label(text, GUILayout.ExpandHeight(true)); + + // Choices + if (_availableChoices.Count > 0) + { + GUILayout.Space(10); + for (int i = 0; i < _availableChoices.Count; i++) + { + string choiceText = OctoLocalization.GetLocalizedText(_availableChoices[i].Text); + if (GUILayout.Button(choiceText)) + { + SelectChoice(i); + } + } + } + else + { + GUILayout.Space(10); + if (GUILayout.Button("→")) + { + Continue(); + } + } + + GUILayout.EndArea(); + GUILayout.EndArea(); + } + + /// + /// Get current dialogue data. + /// + public Data.OctoDialogueData GetCurrentDialogue() + { + return _currentDialogue; + } + + /// + /// Get available choices for current entry. + /// + public List GetAvailableChoices() + { + return new List(_availableChoices); + } + + /// + /// Check if dialogue is currently active. + /// + public bool IsActive() + { + return _isActive; + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueManager.cs.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueManager.cs.meta new file mode 100644 index 00000000..efe8303f --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Components/OctoDialogueManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5a41b5f79f61ad94c9479c28b4397de4 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Data.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data.meta new file mode 100644 index 00000000..01a387d9 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be1a654d39699564cb1dc1342aa93085 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoDialogueData.cs b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoDialogueData.cs new file mode 100644 index 00000000..46d0e9b7 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoDialogueData.cs @@ -0,0 +1,18 @@ +using UnityEngine; + +namespace OctoCore.Dialogue.Data +{ + /// + /// Dialogue data containing a sequence of entries. + /// + [CreateAssetMenu(fileName = "dialogue_", menuName = "OctoCore/Dialogue/Dialogue Data", order = 1)] + public class OctoDialogueData : ScriptableObject + { + /// + /// Sequence of dialogue entries. + /// First entry starts automatically. + /// + [Tooltip("Sequence of dialogue entries")] + public OctoDialogueEntry[] Entries; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoDialogueData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoDialogueData.cs.meta new file mode 100644 index 00000000..42b59b93 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoDialogueData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0c6fdb9b9b4581f4b912b64147fa3969 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoSpeakerData.cs b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoSpeakerData.cs new file mode 100644 index 00000000..d5690f60 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoSpeakerData.cs @@ -0,0 +1,25 @@ +using UnityEngine; +using OctoCore.Localization; + +namespace OctoCore.Dialogue.Data +{ + /// + /// Speaker data for dialogue system. + /// Contains localized name and sprite. + /// + [CreateAssetMenu(fileName = "speaker_", menuName = "OctoCore/Dialogue/Speaker Data", order = 0)] + public class OctoSpeakerData : ScriptableObject + { + /// + /// Localized name of the speaker. + /// + [Tooltip("Localized name of the speaker")] + public OctoLocalizedTextData Name; + + /// + /// Speaker portrait sprite. + /// + [Tooltip("Speaker portrait sprite")] + public Sprite Sprite; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoSpeakerData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoSpeakerData.cs.meta new file mode 100644 index 00000000..52cb9f26 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/Data/OctoSpeakerData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a14c37f184ae07b4b8f641e7e2896ed7 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueChoice.cs b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueChoice.cs new file mode 100644 index 00000000..7b3f9b75 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueChoice.cs @@ -0,0 +1,43 @@ +using UnityEngine; +using OctoCore.Localization; + +namespace OctoCore.Dialogue +{ + /// + /// Dialogue choice with condition and next dialogue. + /// + [System.Serializable] + public class OctoDialogueChoice + { + /// + /// Localized text for this choice. + /// + [Tooltip("Localized text for this choice")] + public OctoLocalizedTextData Text; + + /// + /// Condition to display this choice. + /// If null or condition is true, choice is available. + /// + [Tooltip("Condition to display this choice (null = always show)")] + public OctoDialogueCondition Condition; + + /// + /// Next dialogue to load when this choice is selected. + /// If null, dialogue ends. + /// + [Tooltip("Next dialogue when selected (null = end dialogue)")] + public Data.OctoDialogueData NextDialogue; + + /// + /// Check if this choice should be available. + /// + public bool IsAvailable() + { + if (Condition == null) + return true; + + return Condition.Evaluate(); + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueChoice.cs.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueChoice.cs.meta new file mode 100644 index 00000000..3a589bf5 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueChoice.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7b828f206b626c94a964cbb5e4aaddc4 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueCondition.cs b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueCondition.cs new file mode 100644 index 00000000..e70fd7ba --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueCondition.cs @@ -0,0 +1,90 @@ +using UnityEngine; +using OctoCore.Save.Data; + +namespace OctoCore.Dialogue +{ + /// + /// Condition for dialogue choices. + /// Supports OctoDataBool, OctoDataInt, and OctoDataFloat. + /// + [System.Serializable] + public class OctoDialogueCondition + { + /// + /// Source data to evaluate (OctoDataBool, OctoDataInt, or OctoDataFloat). + /// + [Tooltip("Source data to evaluate")] + public OctoData Source; + + /// + /// Operation to perform. + /// + [Tooltip("Operation to perform")] + public OctoDialogueOperation Operation = OctoDialogueOperation.Equal; + + /// + /// Value to compare against. + /// For bool: 0 = false, 1 = true + /// For int/float: direct comparison + /// + [Tooltip("Value to compare against (bool: 0=false, 1=true)")] + public float Value; + + /// + /// Evaluate if the condition is met. + /// + public bool Evaluate() + { + if (Source == null) + return true; // No condition = always true + + float sourceValue = GetSourceValue(); + + switch (Operation) + { + case OctoDialogueOperation.Equal: + return Mathf.Approximately(sourceValue, Value); + + case OctoDialogueOperation.NotEqual: + return !Mathf.Approximately(sourceValue, Value); + + case OctoDialogueOperation.GreaterThan: + return sourceValue > Value; + + case OctoDialogueOperation.GreaterOrEqual: + return sourceValue >= Value; + + case OctoDialogueOperation.LessThan: + return sourceValue < Value; + + case OctoDialogueOperation.LessOrEqual: + return sourceValue <= Value; + + default: + return true; + } + } + + private float GetSourceValue() + { + if (!OctoCore.Instance) + return 0f; + + if (Source is OctoDataBool dataBool) + { + return OctoCore.Instance.Save.Get(dataBool) ? 1f : 0f; + } + else if (Source is OctoDataInt dataInt) + { + return OctoCore.Instance.Save.Get(dataInt); + } + else if (Source is OctoDataFloat dataFloat) + { + return OctoCore.Instance.Save.Get(dataFloat); + } + + Debug.LogWarning("[OctoDialogueCondition] Unsupported data type: " + Source.GetType().Name); + return 0f; + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueCondition.cs.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueCondition.cs.meta new file mode 100644 index 00000000..918ac87b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueCondition.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 553d5d510ff034f44b70a8a032565a4e \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueEntry.cs b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueEntry.cs new file mode 100644 index 00000000..db2674e8 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueEntry.cs @@ -0,0 +1,31 @@ +using UnityEngine; +using OctoCore.Localization; + +namespace OctoCore.Dialogue +{ + /// + /// Single dialogue entry with speaker, text, and choices. + /// + [System.Serializable] + public class OctoDialogueEntry + { + /// + /// Speaker for this entry. + /// + [Tooltip("Speaker for this entry")] + public Data.OctoSpeakerData Speaker; + + /// + /// Localized dialogue text. + /// + [Tooltip("Localized dialogue text")] + public OctoLocalizedTextData Text; + + /// + /// Available choices for this entry. + /// If empty, dialogue continues automatically or ends. + /// + [Tooltip("Available choices (empty = auto-continue or end)")] + public OctoDialogueChoice[] Choices; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueEntry.cs.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueEntry.cs.meta new file mode 100644 index 00000000..924bd4be --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueEntry.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ec95cc134f0fa214eb3cd8c0e9016347 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueOperation.cs b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueOperation.cs new file mode 100644 index 00000000..e91e3892 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueOperation.cs @@ -0,0 +1,26 @@ +namespace OctoCore.Dialogue +{ + /// + /// Operations for dialogue conditions. + /// + public enum OctoDialogueOperation + { + /// Equal (bool, int, float) + Equal, + + /// Not equal (bool, int, float) + NotEqual, + + /// Greater than (int, float only) + GreaterThan, + + /// Greater or equal (int, float only) + GreaterOrEqual, + + /// Less than (int, float only) + LessThan, + + /// Less or equal (int, float only) + LessOrEqual + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueOperation.cs.meta b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueOperation.cs.meta new file mode 100644 index 00000000..97f098cc --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Dialogue/OctoDialogueOperation.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a4c04f460edc6d949933bd4237fb2e0a \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/IOctoModule.cs b/Packages/OctoCore/Runtime/Scripts/IOctoModule.cs new file mode 100644 index 00000000..065f2421 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/IOctoModule.cs @@ -0,0 +1,36 @@ +using UnityEngine.SceneManagement; + +namespace OctoCore +{ + /// + /// Base interface for all OctoCore modules. + /// Defines the lifecycle methods that all modules must implement. + /// + public interface IOctoModule + { + /// + /// Initializes the module with global settings. + /// Called once during OctoCore startup. + /// + /// Global settings configuration. + void Init(OctoSettings settings); + + /// + /// Called every frame to update the module. + /// + void Tick(); + + /// + /// Called when a scene change occurs. + /// + /// The scene being left. + /// The scene being loaded. + void OnSceneChanged(Scene current, Scene next); + + /// + /// Called when the application is quitting. + /// Use this for cleanup and saving final state. + /// + void OnQuit(); + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/IOctoModule.cs.meta b/Packages/OctoCore/Runtime/Scripts/IOctoModule.cs.meta new file mode 100644 index 00000000..6b2c6464 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/IOctoModule.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 15167e6c98ed86e448464574144f40f4 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Inputs.meta b/Packages/OctoCore/Runtime/Scripts/Inputs.meta new file mode 100644 index 00000000..21a027c6 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Inputs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eb7efa3243ed91043a79bc110b57e653 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Inputs/OctoActions.cs b/Packages/OctoCore/Runtime/Scripts/Inputs/OctoActions.cs new file mode 100644 index 00000000..924bc856 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Inputs/OctoActions.cs @@ -0,0 +1,64 @@ +// ═══════════════════════════════════════════════════════════════════════════ +// AUTO-GENERATED FILE - DO NOT EDIT MANUALLY +// ═══════════════════════════════════════════════════════════════════════════ +// Generated by OctoSettings +// Backup saved in: Assets/OctoCore/Generated/OctoActions.json +// To regenerate: OctoSettings > Mapping > Click 'Generate Inputs' +// Generated from: PlayerController +// Generated on: 2026-02-09 21:55:05 +// ═══════════════════════════════════════════════════════════════════════════ + +namespace OctoCore.Inputs +{ + /// + /// Actions from Unity Input Actions. + /// Generated from: PlayerController + /// Format: ActionMap_ActionName + /// Values are stable hashes to prevent serialization issues when regenerating. + /// + public enum OctoActions + { + /// Player > Move + Player_Move = -560403583, + /// Player > Look + Player_Look = -916633937, + /// Player > Attack + Player_Attack = -350647692, + /// Player > Interact + Player_Interact = -2066596810, + /// Player > Crouch + Player_Crouch = 510396034, + /// Player > Jump + Player_Jump = -1877919292, + /// Player > Previous + Player_Previous = -1566477299, + /// Player > Next + Player_Next = -1266215613, + /// Player > Sprint + Player_Sprint = 1115268836, + /// Player > Diapason + Player_Diapason = -1931519977, + /// Player > Fire + Player_Fire = 380421744, + /// UI > Navigate + UI_Navigate = -1768796602, + /// UI > Submit + UI_Submit = -1966140153, + /// UI > Cancel + UI_Cancel = 728645621, + /// UI > Point + UI_Point = 1869126131, + /// UI > Click + UI_Click = -468029055, + /// UI > RightClick + UI_RightClick = -1344942599, + /// UI > MiddleClick + UI_MiddleClick = 1604886768, + /// UI > ScrollWheel + UI_ScrollWheel = 207319517, + /// UI > TrackedDevicePosition + UI_TrackedDevicePosition = 1110904968, + /// UI > TrackedDeviceOrientation + UI_TrackedDeviceOrientation = 1632432327 + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Inputs/OctoActions.cs.meta b/Packages/OctoCore/Runtime/Scripts/Inputs/OctoActions.cs.meta new file mode 100644 index 00000000..52e1d265 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Inputs/OctoActions.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 84cdf2dfd7a86434b9cd00c7a43c58e8 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Inputs/OctoInputs.cs b/Packages/OctoCore/Runtime/Scripts/Inputs/OctoInputs.cs new file mode 100644 index 00000000..1fe864d5 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Inputs/OctoInputs.cs @@ -0,0 +1,366 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; +using static OctoCore.OctoSettings; + +#if ENABLE_INPUT_SYSTEM +using UnityEngine.InputSystem; +#endif + +namespace OctoCore.Inputs +{ + /// + /// Input management module that wraps Unity's Input System. + /// Provides enum-based API with automatic enable/disable based on subscriptions. + /// + [System.Serializable] + public class OctoInputs : IOctoModule + { + [System.Serializable] + public class ActionInfo + { + [HideInInspector] + public string Name; + + [HideInInspector] + public string MapName; + + public bool Enabled; + + [Tooltip("List of registered callbacks")] + public string[] Callbacks; + +#if ENABLE_INPUT_SYSTEM + [System.NonSerialized] + public InputActionReference Reference; + + [System.NonSerialized] + public List CallbacksList = new List(); + + [System.NonSerialized] + public List> CallbacksVector2List = new List>(); + + [System.NonSerialized] + public Vector2 LastValue = Vector2.zero; +#endif + + public ActionInfo(string name, string mapName) + { + Name = name; + MapName = mapName; + Enabled = false; + Callbacks = new string[0]; + } + } + + [Header("Actions")] + public List Actions = new List(); + +#if ENABLE_INPUT_SYSTEM + private MappingSettings _mappingData; + private Dictionary _actionsDict = new Dictionary(); + private Dictionary _actionMaps = new Dictionary(); + private bool _initialized; +#endif + + public void Init(OctoSettings settings) + { +#if ENABLE_INPUT_SYSTEM + _mappingData = settings.Mapping; + + if (_mappingData == null) + { + Debug.LogError("[OctoInputs] No mapping settings found in OctoSettings."); + return; + } + + if (_mappingData.InputActionAsset == null) + { + Debug.LogError("[OctoInputs] No InputActionAsset assigned in OctoSettings."); + return; + } + + BuildActions(); + _initialized = true; + + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoInputs] Initialized with {_actionsDict.Count} actions."); +#else + Debug.LogWarning("[OctoInputs] Input System Package is not enabled."); +#endif + + // Callback OctoEvents + if (OctoEvents.Instance) + OctoEvents.Instance.SetInputsInitialized(); + } + +#if ENABLE_INPUT_SYSTEM + private void BuildActions() + { + Actions.Clear(); + _actionsDict.Clear(); + _actionMaps.Clear(); + + // Cache all action maps + foreach (var map in _mappingData.InputActionAsset.actionMaps) + { + _actionMaps[map.name] = map; + } + + // Build actions list + foreach (var actionData in _mappingData.Actions) + { + var actionInfo = new ActionInfo(actionData.Name, actionData.MapName); + actionInfo.Reference = actionData.Reference; + + Actions.Add(actionInfo); + _actionsDict[actionData.Action] = actionInfo; + } + } + + private void EnableAction(OctoActions action) + { + if (!_actionsDict.TryGetValue(action, out var actionInfo)) + return; + + if (actionInfo.Enabled || actionInfo.Reference == null) + return; + + actionInfo.Reference.action.Enable(); + actionInfo.Enabled = true; + + // Enable parent action map if needed + if (_actionMaps.TryGetValue(actionInfo.MapName, out var actionMap)) + { + if (!actionMap.enabled) + { + actionMap.Enable(); + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoInputs] Enabled action map: {actionInfo.MapName}"); + } + } + + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoInputs] Enabled action: {action}"); + } + + private void DisableAction(OctoActions action) + { + if (!_actionsDict.TryGetValue(action, out var actionInfo)) + return; + + if (!actionInfo.Enabled || actionInfo.Reference == null) + return; + + // Check if there are still callbacks + int totalCallbacks = actionInfo.CallbacksList.Count + actionInfo.CallbacksVector2List.Count; + if (totalCallbacks > 0) + return; + + actionInfo.Reference.action.Disable(); + actionInfo.Enabled = false; + + // Check if we should disable the action map + CheckActionMapState(actionInfo.MapName); + + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoInputs] Disabled action: {action}"); + } + + private void CheckActionMapState(string mapName) + { + if (!_actionMaps.TryGetValue(mapName, out var actionMap)) + return; + + // Check if any actions in this map are still enabled + bool hasActiveActions = false; + foreach (var actionInfo in Actions) + { + if (actionInfo.MapName == mapName && actionInfo.Enabled) + { + hasActiveActions = true; + break; + } + } + + // Disable map if no active actions + if (!hasActiveActions && actionMap.enabled) + { + actionMap.Disable(); + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoInputs] Disabled action map: {mapName}"); + } + } + + private void UpdateCallbacksList(OctoActions action) + { + if (!_actionsDict.TryGetValue(action, out var actionInfo)) + return; + + var callbackNames = new List(); + + foreach (var callback in actionInfo.CallbacksList) + { + if (callback != null) + callbackNames.Add($"{callback.Method.DeclaringType?.Name}.{callback.Method.Name}"); + } + + foreach (var callback in actionInfo.CallbacksVector2List) + { + if (callback != null) + callbackNames.Add($"{callback.Method.DeclaringType?.Name}.{callback.Method.Name} (Vector2)"); + } + + actionInfo.Callbacks = callbackNames.ToArray(); + } +#endif + + public void Tick() + { +#if ENABLE_INPUT_SYSTEM + if (!_initialized) + return; + + // Poll continuous actions (Vector2 callbacks) + foreach (var kvp in _actionsDict) + { + var actionInfo = kvp.Value; + + // Only poll enabled actions with callbacks + if (actionInfo.Enabled && + actionInfo.Reference != null && + (actionInfo.CallbacksList.Count > 0 || actionInfo.CallbacksVector2List.Count > 0) && + actionInfo.Reference.action.IsPressed()) + { + // Call Action callbacks + foreach (var callback in actionInfo.CallbacksList.ToArray()) + { + callback?.Invoke(); + } + + // Call Vector2 callbacks + foreach (var callback in actionInfo.CallbacksVector2List.ToArray()) + { + Vector2 value = actionInfo.Reference.action.ReadValue(); + callback?.Invoke(value); + } + } + } +#endif + } + + public void OnSceneChanged(Scene current, Scene next) + { + } + + public void OnQuit() + { +#if ENABLE_INPUT_SYSTEM + if (_mappingData != null && _mappingData.InputActionAsset != null) + { + _mappingData.InputActionAsset.Disable(); + } +#endif + } + + /// + /// Subscribe to an action with no parameters (button press). + /// + public void SubscribeAction(OctoActions action, Action callback, bool subscribe = true) + { +#if ENABLE_INPUT_SYSTEM + if (!_initialized || callback == null) + return; + + if (!_actionsDict.TryGetValue(action, out var actionInfo)) + { + Debug.LogWarning($"[OctoInputs] Action {action} not found."); + return; + } + + if (actionInfo.Reference == null) + { + Debug.LogWarning($"[OctoInputs] InputActionReference is null for {action}."); + return; + } + + if (subscribe) + { + if (!actionInfo.CallbacksList.Contains(callback)) + { + actionInfo.CallbacksList.Add(callback); + + EnableAction(action); + UpdateCallbacksList(action); + } + } + else + { + actionInfo.CallbacksList.Remove(callback); + + DisableAction(action); + UpdateCallbacksList(action); + } +#endif + } + + /// + /// Subscribe to an action with Vector2 parameter (movement, look). + /// Uses continuous polling in Tick() to call the callback while pressed. + /// + public void SubscribeAction(OctoActions action, Action callback, bool subscribe = true) + { +#if ENABLE_INPUT_SYSTEM + if (!_initialized || callback == null) + return; + + if (!_actionsDict.TryGetValue(action, out var actionInfo)) + { + Debug.LogWarning($"[OctoInputs] Action {action} not found."); + return; + } + + if (actionInfo.Reference == null) + { + Debug.LogWarning($"[OctoInputs] InputActionReference is null for {action}."); + return; + } + + if (subscribe) + { + if (!actionInfo.CallbacksVector2List.Contains(callback)) + { + actionInfo.CallbacksVector2List.Add(callback); + + EnableAction(action); + UpdateCallbacksList(action); + } + } + else + { + actionInfo.CallbacksVector2List.Remove(callback); + + DisableAction(action); + UpdateCallbacksList(action); + } +#endif + } + + /// + /// Unsubscribe from an action. + /// + public void UnsubscribeAction(OctoActions action, Action callback) + { + SubscribeAction(action, callback, false); + } + + /// + /// Unsubscribe from an action with Vector2. + /// + public void UnsubscribeAction(OctoActions action, Action callback) + { + SubscribeAction(action, callback, false); + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Inputs/OctoInputs.cs.meta b/Packages/OctoCore/Runtime/Scripts/Inputs/OctoInputs.cs.meta new file mode 100644 index 00000000..880769b4 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Inputs/OctoInputs.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c5ddaafd81189174185c64028547631d \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level.meta b/Packages/OctoCore/Runtime/Scripts/Level.meta new file mode 100644 index 00000000..6093e1df --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50247461158afe041a87e1db4ab8a806 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data.meta b/Packages/OctoCore/Runtime/Scripts/Level/Data.meta new file mode 100644 index 00000000..96e7efaf --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e212b1c0974558f40ac2ccaa96db495d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderCeilingData.cs b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderCeilingData.cs new file mode 100644 index 00000000..f15bb37b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderCeilingData.cs @@ -0,0 +1,18 @@ +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /// + /// Data for ceiling tiles. + /// + [CreateAssetMenu(fileName = "Ceiling_", menuName = "Octo/Level Builder/Ceiling")] + public class OctoLevelBuilderCeilingData : OctoLevelBuilderData + { + public GameObject Prefab; + + public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight) + { + return Prefab; + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderCeilingData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderCeilingData.cs.meta new file mode 100644 index 00000000..3ba88f1c --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderCeilingData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 663b230d0aa40fb448ac219c0c7d57f6 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderData.cs b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderData.cs new file mode 100644 index 00000000..c4639ce8 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderData.cs @@ -0,0 +1,20 @@ +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /// + /// Base class for tile data. + /// + public abstract class OctoLevelBuilderData : ScriptableObject + { + /// + /// The referenece grid for the tile. + /// + public OctoLevelBuilderGridData Grid; + + /// + /// Get the prefab to instantiate for this tile configuration. + /// + public abstract GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight); + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderData.cs.meta new file mode 100644 index 00000000..98e43b6a --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c8ed7c7ac825b7e49aa3695b5393da29 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFenceData.cs b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFenceData.cs new file mode 100644 index 00000000..360f9062 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFenceData.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /// + /// Data for fence tiles. + /// Similar to walls but typically lower and more decorative. + /// + [CreateAssetMenu(fileName = "Fence_", menuName = "Octo/Level Builder/Fence")] + public class OctoLevelBuilderFenceData : OctoLevelBuilderData + { + [Header("Fence Prefabs")] + public GameObject FenceStraight; + public GameObject FenceCorner; + public GameObject FenceT; + public GameObject FenceDeadEnd; + + public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight) + { + return shape switch + { + WallShape.Straight => FenceStraight, + WallShape.Corner => FenceCorner, + WallShape.T => FenceT, + WallShape.DeadEnd => FenceDeadEnd, + _ => FenceStraight + }; + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFenceData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFenceData.cs.meta new file mode 100644 index 00000000..7c38c7aa --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFenceData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5d87d7d32e3833944be2a3972446de25 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFloorData.cs b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFloorData.cs new file mode 100644 index 00000000..220e685c --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFloorData.cs @@ -0,0 +1,18 @@ +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /// + /// Data for floor tiles. + /// + [CreateAssetMenu(fileName = "Floor_", menuName = "Octo/Level Builder/Floor")] + public class OctoLevelBuilderFloorData : OctoLevelBuilderData + { + public GameObject Prefab; + + public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight) + { + return Prefab; + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFloorData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFloorData.cs.meta new file mode 100644 index 00000000..3d496329 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderFloorData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c8e08d3fd3a3b694da03a093f5b375cf \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderGridData.cs b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderGridData.cs new file mode 100644 index 00000000..1fa80f18 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderGridData.cs @@ -0,0 +1,21 @@ +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /// + /// Base class for grid data. + /// + [CreateAssetMenu(fileName = "Grid_", menuName = "Octo/Level Builder/Grid")] + public class OctoLevelBuilderGridData : ScriptableObject + { + /// + /// Width en depth of a tile. + /// + public float TileSize = 2f; + + /// + /// Floor height. + /// + public float FloorHeight = 3.5f; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderGridData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderGridData.cs.meta new file mode 100644 index 00000000..e4bd4e11 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderGridData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5b13c2498f7c6bd499d3dc1815e1758d diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStairsData.cs b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStairsData.cs new file mode 100644 index 00000000..602bd495 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStairsData.cs @@ -0,0 +1,20 @@ +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /// + /// Data for stairs tiles. + /// Connects two floor levels. + /// + [CreateAssetMenu(fileName = "Stairs_", menuName = "Octo/Level Builder/Stairs")] + public class OctoLevelBuilderStairsData : OctoLevelBuilderData + { + [Header("Stairs Prefab")] + public GameObject StairsPrefab; + + public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight) + { + return StairsPrefab; + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStairsData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStairsData.cs.meta new file mode 100644 index 00000000..3dc0739e --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStairsData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 77641830072b3944882267f440086535 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStyleData.cs b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStyleData.cs new file mode 100644 index 00000000..a0ff6aab --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStyleData.cs @@ -0,0 +1,18 @@ +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /// + /// Base class for grid data. + /// + [CreateAssetMenu(fileName = "Style_", menuName = "Octo/Level Builder/Style")] + public class OctoLevelBuilderStyleData : ScriptableObject + { + public OctoLevelBuilderGridData Grid; + public OctoLevelBuilderCeilingData Ceiling; + public OctoLevelBuilderWallData Wall; + public OctoLevelBuilderFloorData Floor; + public OctoLevelBuilderStairsData Stairs; + public OctoLevelBuilderFenceData Fence; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStyleData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStyleData.cs.meta new file mode 100644 index 00000000..f3741a35 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderStyleData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c0d5c998a010b2243b41c3eb69285ff5 diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderWallData.cs b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderWallData.cs new file mode 100644 index 00000000..76c28884 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderWallData.cs @@ -0,0 +1,36 @@ +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + /// + /// Data for wall tiles. + /// Supports different shapes: straight, corner, T-junction, cross, dead-end, door, window. + /// + [CreateAssetMenu(fileName = "Wall_", menuName = "Octo/Level Builder/Wall")] + public class OctoLevelBuilderWallData : OctoLevelBuilderData + { + [Header("Wall Prefabs")] + public GameObject WallStraight; + public GameObject WallCorner; + public GameObject WallT; + public GameObject WallCross; + public GameObject WallDeadEnd; + public GameObject WallDoor; + public GameObject WallWindow; + + public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight) + { + return shape switch + { + WallShape.Straight => WallStraight, + WallShape.Corner => WallCorner, + WallShape.T => WallT, + WallShape.Cross => WallCross, + WallShape.DeadEnd => WallDeadEnd, + WallShape.Door => WallDoor, + WallShape.Window => WallWindow, + _ => WallStraight + }; + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderWallData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderWallData.cs.meta new file mode 100644 index 00000000..de1e7ab1 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/Data/OctoLevelBuilderWallData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b5eb6603754edde4f85b7713df5381a4 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderEnums.cs b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderEnums.cs new file mode 100644 index 00000000..319f8e68 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderEnums.cs @@ -0,0 +1,29 @@ +namespace OctoCore.LevelBuilder +{ + public enum TileType + { + Wall, + Floor, + Stairs, + Fence + } + + public enum WallShape + { + Straight, + Corner, + T, + Cross, + DeadEnd, + Door, + Window + } + + public enum WallType + { + Wall, + Door, + Window, + Fence + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderEnums.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderEnums.cs.meta new file mode 100644 index 00000000..8fb45d4b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderEnums.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0d4bac6e1a95c924db7e2c026cc28e70 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderMap.cs b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderMap.cs new file mode 100644 index 00000000..293a6b2b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderMap.cs @@ -0,0 +1,337 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + [ExecuteAlways] + public class OctoLevelBuilderMap : MonoBehaviour + { + [System.Serializable] + private class MapRow + { + public OctoLevelBuilderTile[] Rows; + } + + [System.Serializable] + private class MapColumn + { + public MapRow[] Columns; + } + + [System.Serializable] + private class Map + { + private bool _isMapUpToDate; + [SerializeField] private Vector3Int _minBounds; + [SerializeField] private Vector3Int _maxBounds; + [SerializeField] private Transform _tilesRoot; + [SerializeField] private List _tiles = new List(); + private List _tilesToRefresh = new List(); + [SerializeField] private MapColumn[] _floors = new MapColumn[0]; + + public Transform TilesRoot => _tilesRoot; + public OctoLevelBuilderTile[] Tiles => _tiles.ToArray(); + + public void SetTilesRoot(Transform tilesRoot) + { + _tilesRoot = tilesRoot; + } + + public void RequireMapRefresh() + { + _isMapUpToDate = false; + } + + public void RequireTileRefresh(OctoLevelBuilderTile tile) + { + if (tile && !_tilesToRefresh.Contains(tile)) + _tilesToRefresh.Add(tile); + } + + public void AddTile(OctoLevelBuilderTile tile) + { + if (!_tiles.Contains(tile)) + { + _tiles.Add(tile); + RequireMapRefresh(); + } + } + + public void RemoveTile(OctoLevelBuilderTile tile) + { + if (_tiles.Contains(tile)) + { + _tiles.Remove(tile); + RequireMapRefresh(); + } + } + + public OctoLevelBuilderTile GetTile(Vector3Int position) + { + Vector3Int p = position - _minBounds; + + if (p.y < 0 || p.y >= _floors.Length) + return null; + + if (p.z < 0 || p.z >= _floors[p.y].Columns.Length) + return null; + + if (p.x < 0 || p.x >= _floors[p.y].Columns[p.z].Rows.Length) + return null; + + return _floors[p.y].Columns[p.z].Rows[p.x]; + } + + public void RefreshMap(string name) + { + if (_isMapUpToDate) + return; + + _minBounds = new Vector3Int(int.MaxValue, int.MaxValue, int.MaxValue); + _maxBounds = new Vector3Int(int.MinValue, int.MinValue, int.MinValue); + + // Get map bounds + + foreach (OctoLevelBuilderTile tile in _tiles) + { + Vector3Int p = tile.GetCoordinates(true); + + if (p.x < _minBounds.x) + _minBounds.x = p.x; + if (p.x > _maxBounds.x) + _maxBounds.x = p.x; + if (p.y < _minBounds.y) + _minBounds.y = p.y; + if (p.y > _maxBounds.y) + _maxBounds.y = p.y; + if (p.z < _minBounds.z) + _minBounds.z = p.z; + if (p.z > _maxBounds.z) + _maxBounds.z = p.z; + } + + // Copy previous map + + MapColumn[] previousFloors = new MapColumn[_floors.Length]; + + for (int y = 0; y < previousFloors.Length; y++) + { + previousFloors[y] = new MapColumn(); + previousFloors[y].Columns = new MapRow[_floors[y].Columns.Length]; + + for (int z = 0; z < previousFloors[y].Columns.Length; z++) + { + previousFloors[y].Columns[z] = new MapRow(); + previousFloors[y].Columns[z].Rows = new OctoLevelBuilderTile[_floors[y].Columns[z].Rows.Length]; + + for (int x = 0; x < previousFloors[y].Columns[z].Rows.Length; x++) + previousFloors[y].Columns[z].Rows[x] = _floors[y].Columns[z].Rows[x]; + } + } + + // Init map + + Vector3Int size = _maxBounds - _minBounds + Vector3Int.one; + _floors = new MapColumn[size.y]; + + for (int y = 0; y < size.y; y++) + { + _floors[y] = new MapColumn(); + _floors[y].Columns = new MapRow[size.z]; + + for (int z = 0; z < size.z; z++) + { + _floors[y].Columns[z] = new MapRow(); + _floors[y].Columns[z].Rows = new OctoLevelBuilderTile[size.x]; + } + } + + // Assing tiles to the map + + foreach (OctoLevelBuilderTile tile in _tiles) + { + Vector3Int p = tile.GetCoordinates(true) - _minBounds; + + _floors[p.y].Columns[p.z].Rows[p.x] = tile; + } + + // Refresh tiles + + for (int y = 0; y < size.y; y++) + { + for (int z = 0; z < size.z; z++) + { + for (int x = 0; x < size.x; x++) + { + OctoLevelBuilderTile tile = _floors[y].Columns[z].Rows[x]; + + if (tile) + { + bool refreshTile = !tile.IsUpToDate; + + if (!refreshTile) + { + OctoLevelBuilderTile previousTile = null; + if (previousFloors.Length > y && previousFloors[y].Columns.Length > z && previousFloors[y].Columns[z].Rows.Length > x) + previousTile = previousFloors[y].Columns[z].Rows[x]; + + refreshTile = tile != previousTile; + } + + if (refreshTile) + { + RequireTileRefresh(tile); + } + } + } + } + } + + _isMapUpToDate = true; + Debug.Log($"[OctoLevelGrid] {name}: Updated"); + } + + public void RefreshTiles() + { + if (_tilesToRefresh.Count == 0) + return; + + OctoLevelBuilderTile[] _tmpTilesToRefresh = _tilesToRefresh.ToArray(); + _tilesToRefresh.Clear(); + + foreach (OctoLevelBuilderTile tile in _tmpTilesToRefresh) + if (tile) + tile.Refresh(); + } + } + + public static float DEFAULT_TILE_SIZE = 2f; + public static float DEFAULT_FLOOR_HEIGHT = 3.5f; + + [SerializeField] private OctoLevelBuilderStyleData _defaultStyle; + [SerializeField, OctoReadOnly] private Map _map; + + public OctoLevelBuilderStyleData DefaultStyle => _defaultStyle; + public OctoLevelBuilderGridData Grid => DefaultStyle ? DefaultStyle.Grid : null; + public float TileSize => Grid ? Grid.TileSize : DEFAULT_TILE_SIZE; + public float FloorHeight => Grid ? Grid.FloorHeight : DEFAULT_FLOOR_HEIGHT; + + void LateUpdate() + { + if (Application.isPlaying) + return; + + _map.RefreshTiles(); + _map.RefreshMap(name); + } + + public void SetLayer(string layer) + { + LayerMask layerMask = LayerMask.NameToLayer(layer); + SetLayerRecursively(gameObject, layerMask); + } + + public void RegisterTile(OctoLevelBuilderTile tile) + { + if (tile == null) + return; + + _map.AddTile(tile); + } + + public void UnregisterTile(OctoLevelBuilderTile tile) + { + if (tile == null) + return; + + _map.RemoveTile(tile); + } + + public void RequireMapRefresh() + { + _map.RequireMapRefresh(); + } + + public void RequireTileRefresh(OctoLevelBuilderTile tile) + { + if (tile) + _map.RequireTileRefresh(tile); + } + + public bool GetTile(Vector3Int gridPosition, out OctoLevelBuilderTile tile) + { + tile = _map.GetTile(gridPosition); + return tile; + } + + public Vector3 GridToWorld(Vector3Int gridPosition) + { + return new Vector3( + gridPosition.x * TileSize, + gridPosition.y * FloorHeight, + gridPosition.z * TileSize + ); + } + + public Vector3Int WorldToGrid(Vector3 worldPosition, int floorLevel) + { + return new Vector3Int( + Mathf.RoundToInt(worldPosition.x / TileSize), + floorLevel, + Mathf.RoundToInt(worldPosition.z / TileSize) + ); + } + + [ContextMenu("GenerateMap (5x5)")] public void GenerateMap5x5() { GenerateMap(new Vector3Int(5, 1, 5)); } + [ContextMenu("GenerateMap (7x7)")] public void GenerateMap7x7() { GenerateMap(new Vector3Int(7, 1, 7)); } + [ContextMenu("GenerateMap (9x9)")] public void GenerateMap9x9() { GenerateMap(new Vector3Int(9, 1, 9)); } + public void GenerateMap(Vector3Int size) + { + if (!_map.TilesRoot) + { + GameObject tilesRoot = new GameObject("Tiles"); + tilesRoot.transform.parent = transform; + + _map.SetTilesRoot(tilesRoot.transform); + } + + int xMin = size.x / -2; + int yMin = size.y / -2; + int zMin = size.z / -2; + + int xMax = xMin + size.x; + int yMax = yMin + size.y; + int zMax = zMin + size.z; + + for (int y = yMin; y < yMax; y++) + { + for (int z = zMin; z < zMax; z++) + { + for (int x = xMin; x < xMax; x++) + { + GameObject tileObj = new GameObject(); + tileObj.transform.parent = _map.TilesRoot; + tileObj.transform.localPosition = new Vector3(x * TileSize, y * FloorHeight, z * TileSize); + + OctoLevelBuilderTile tile = tileObj.AddComponent(); + tile.Init(x == xMin || x == xMax - 1 || z == zMin || z == zMax - 1); + } + } + } + + Debug.Log("[OctoLevelBluiderMap] Map generated"); + } + + private void SetLayerRecursively(GameObject obj, int newLayer) + { + obj.layer = newLayer; + + foreach (Transform child in obj.transform) + { + SetLayerRecursively(child.gameObject, newLayer); + } + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderMap.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderMap.cs.meta new file mode 100644 index 00000000..02f210fb --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderMap.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 078c608cc8fc63b40beb970edf317e56 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderTile.cs b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderTile.cs new file mode 100644 index 00000000..337c4d92 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderTile.cs @@ -0,0 +1,614 @@ +using UnityEditor; +using UnityEngine; + +namespace OctoCore.LevelBuilder +{ + [ExecuteAlways] + public class OctoLevelBuilderTile : MonoBehaviour + { + [System.Serializable] + private class Configuration + { + public OctoLevelBuilderStyleData _overrideStyle; + public bool Ceiling; + public bool Wall; + public bool Floor; + public bool Stairs; + } + + [System.Serializable] + private class References + { + [OctoReadOnly] public OctoLevelBuilderMap Map; + [OctoReadOnly] public GameObject CeilingInstance; + [OctoReadOnly] public GameObject WallInstance; + [OctoReadOnly] public GameObject FloorInstance; + } + + [System.Serializable] + private class WallConnections + { + public OctoLevelBuilderTile North; + public OctoLevelBuilderTile Est; + public OctoLevelBuilderTile South; + public OctoLevelBuilderTile West; + } + + [System.Serializable] + private class WallConfiguration + { + public bool AutoConnect = true; + [Range(0, 3)] public int Orientation = 0; + public WallType Type = WallType.Wall; + public WallShape Shape = WallShape.Straight; + [OctoReadOnly] public WallConnections Connections = new WallConnections(); + } + + [System.Serializable] + private class Infos + { + public Vector3Int Coordinates; + public Vector3 Position; + } + + [SerializeField] private Configuration _configuration = new Configuration(); + [SerializeField] private WallConfiguration _wall = new WallConfiguration(); + [SerializeField] private References _references = new References(); + [SerializeField, OctoReadOnly] private Infos _infos = new Infos(); + + private bool _isMapUpToDate; + + public bool IsUpToDate => _isMapUpToDate; + public bool HasWall => _configuration.Wall; + public bool HasFloor => _configuration.Floor; + public bool HasCeiling => _configuration.Ceiling; + public bool HasStairs => _configuration.Stairs; + public float TileSize => Map ? Map.TileSize : OctoLevelBuilderMap.DEFAULT_TILE_SIZE; + public float FloorHeight => Map ? Map.FloorHeight : OctoLevelBuilderMap.DEFAULT_FLOOR_HEIGHT; + public OctoLevelBuilderMap Map => _references.Map; + public OctoLevelBuilderStyleData Style => _configuration._overrideStyle ? _configuration._overrideStyle : _references.Map ? _references.Map.DefaultStyle : null; + +#if UNITY_EDITOR + void OnValidate() + { + if (!Application.isPlaying) + { + UnityEditor.EditorApplication.delayCall += () => + { + if (this != null) + RequireMapRefresh(); + }; + } + } +#endif + + void OnEnable() + { +#if UNITY_EDITOR + if (!Application.isPlaying) + { + RegisterToMap(); + } +#endif + } + + void OnDisable() + { +#if UNITY_EDITOR + if (!Application.isPlaying) + { + UnregisterFromMap(); + //DestroyInstance(_wallInstance); + //DestroyInstance(_floorInstance); + //DestroyInstance(_ceilingInstance); + + _references.Map.RequireTileRefresh(_wall.Connections.North); + _references.Map.RequireTileRefresh(_wall.Connections.Est); + _references.Map.RequireTileRefresh(_wall.Connections.South); + _references.Map.RequireTileRefresh(_wall.Connections.West); + } +#endif + } + +#if UNITY_EDITOR + private void OnDrawGizmos() + { + DrawTileGizmo(new Color(0, 1, 0, 0.2f)); + } + + private void OnDrawGizmosSelected() + { + DrawTileGizmo(new Color(0, 1, 0, 0.5f)); + } + + private void DrawTileGizmo(Color color) + { + float tileSize = Map ? Map.TileSize : 2; + + Gizmos.matrix = transform.localToWorldMatrix; + Gizmos.color = color; + Gizmos.DrawCube(Vector3.up * tileSize * .025f, new Vector3(tileSize * .2f, tileSize * .05f, tileSize * .2f)); + + /*if (!HasWall()) + { + Gizmos.color = color; + Gizmos.DrawCube(transform.position + Vector3.up * 0.5f, new Vector3(1.8f, 1f, 1.8f)); + return; + } + + float rotation = Placement.Angle * -90f; + if (Wall.Shape == WallShape.Straight) + rotation += 90f; + + Matrix4x4 oldMatrix = Gizmos.matrix; + Gizmos.matrix = Matrix4x4.TRS(transform.position + Vector3.up * 1.5f, Quaternion.Euler(0, rotation, 0), Vector3.one); + Gizmos.color = color; + + float size = 2f; + float thickness = 0.3f; + float height = 3f; + + switch (Wall.Shape) + { + case WallShape.Straight: + Gizmos.DrawCube(Vector3.zero, new Vector3(size, height, thickness)); + break; + + case WallShape.Corner: + Vector3 arm1Pos = new Vector3(size / 4f, 0, 0); + Vector3 arm2Pos = new Vector3(0, 0, size / 4f); + Gizmos.DrawCube(arm1Pos, new Vector3(size / 2f, height, thickness)); + Gizmos.DrawCube(arm2Pos, new Vector3(thickness, height, size / 2f)); + break; + + case WallShape.T: + Vector3 basePos = new Vector3(0, 0, 0); + Vector3 crossPos = new Vector3(0, 0, size / 4f); + Gizmos.DrawCube(basePos, new Vector3(size, height, thickness)); + Gizmos.DrawCube(crossPos, new Vector3(thickness, height, size / 2f)); + break; + + case WallShape.Cross: + Gizmos.DrawCube(Vector3.zero, new Vector3(size, height, thickness)); + Gizmos.DrawCube(Vector3.zero, new Vector3(thickness, height, size)); + break; + + case WallShape.DeadEnd: + Vector3 deadEndPos = new Vector3(0, 0, size / 4f); + Gizmos.DrawCube(deadEndPos, new Vector3(thickness, height, size / 2f)); + break; + + case WallShape.Door: + case WallShape.Window: + Gizmos.DrawCube(Vector3.zero, new Vector3(size, height, thickness)); + break; + + default: + Gizmos.DrawCube(Vector3.zero, new Vector3(size * 0.5f, height, size * 0.5f)); + break; + } + + Gizmos.matrix = oldMatrix;*/ + } +#endif + + void Update() + { + if (_infos.Position != transform.localPosition) + { + _infos.Position = transform.localPosition; + + SetName(); + RequireMapRefresh(); + } + } + + public void Init(bool wall) + { + Debug.Log(wall); + SetName(); + + _configuration.Ceiling = true; + _configuration.Wall = wall; + _configuration.Floor = true; + } + + public void Refresh() + { + SetConnections(); + ClearChildren(); + RefreshWall(); + RefreshFloor(); + RefreshCeiling(); + + _isMapUpToDate = true; + //Debug.Log($"[OctoTile] {name}: Updated"); + } + + public Vector3Int GetCoordinates(bool update = false) + { + if (update) + SetCoordinates(); + + return _infos.Coordinates; + } + + private void SetCoordinates() + { + Vector3 pos = transform.position; + + _infos.Coordinates = new Vector3Int( + Mathf.RoundToInt(pos.x / TileSize), + Mathf.RoundToInt(pos.y / FloorHeight), + Mathf.RoundToInt(pos.z / TileSize) + ); + } + + public void SetConnections() + { + GetMap(); + if (!_references.Map) + return; + + // Require update for previous connections + + OctoLevelBuilderTile previousNorth = _wall.Connections.North; + OctoLevelBuilderTile previousEst = _wall.Connections.Est; + OctoLevelBuilderTile previousSouth = _wall.Connections.South; + OctoLevelBuilderTile previousWest = _wall.Connections.West; + + // Get new connections + + OctoLevelBuilderTile newNorth = GetNextTile(Vector3Int.forward); + OctoLevelBuilderTile newEst = GetNextTile(Vector3Int.right ); + OctoLevelBuilderTile newSouth = GetNextTile(Vector3Int.back ); + OctoLevelBuilderTile newWest = GetNextTile(Vector3Int.left ); + + _wall.Connections.North = newNorth && newNorth.HasWall ? newNorth : null; + _wall.Connections.Est = newEst && newEst .HasWall ? newEst : null; + _wall.Connections.South = newSouth && newSouth.HasWall ? newSouth : null; + _wall.Connections.West = newWest && newWest .HasWall ? newWest : null; + + bool wallChanged = HasWall != (_references.WallInstance ? true : false); + + // Require update for new connections + + if (_wall.Connections.North != previousNorth || wallChanged) + { + Debug.Log(_wall.Connections.North); + Debug.Log(previousNorth); + _references.Map.RequireTileRefresh(_wall.Connections.North); + _references.Map.RequireTileRefresh(previousNorth); + } + if (_wall.Connections.Est != previousEst || wallChanged) + { + Debug.Log(_wall.Connections.Est); + Debug.Log(previousEst); + _references.Map.RequireTileRefresh(_wall.Connections.Est); + _references.Map.RequireTileRefresh(previousEst); + } + if (_wall.Connections.South != previousSouth || wallChanged) + { + Debug.Log(_wall.Connections.South); + Debug.Log(previousSouth); + _references.Map.RequireTileRefresh(_wall.Connections.South); + _references.Map.RequireTileRefresh(previousSouth); + } + if (_wall.Connections.West != previousWest || wallChanged) + { + Debug.Log(_wall.Connections.West); + Debug.Log(previousWest); + _references.Map.RequireTileRefresh(_wall.Connections.West); + _references.Map.RequireTileRefresh(previousWest); + } + } + + private void RefreshShape() + { + if (!HasWall || !_wall.AutoConnect) + return; + + int connectionHash = (_wall.Connections.North ? 1000 : 0) + (_wall.Connections.Est ? 100 : 0) + (_wall.Connections.South ? 10 : 0) + (_wall.Connections.West ? 1 : 0); + int connectionCount = (_wall.Connections.North ? 1 : 0) + (_wall.Connections.Est ? 1 : 0) + (_wall.Connections.South ? 1 : 0) + (_wall.Connections.West ? 1 : 0); + + switch (connectionCount) + { + default: + _wall.Shape = WallShape.DeadEnd; + switch(connectionHash) + { + case 0010: + _wall.Orientation = 0; + break; + case 0001: + _wall.Orientation = 1; + break; + case 1000: + _wall.Orientation = 2; + break; + case 0100: + _wall.Orientation = 3; + break; + } + break; + + case 2: + if ((_wall.Connections.North && _wall.Connections.South) || (_wall.Connections.Est && _wall.Connections.West)) + { + _wall.Shape = WallShape.Straight; + switch (connectionHash) + { + case 0101: + _wall.Orientation = 0; + break; + case 1010: + _wall.Orientation = 1; + break; + } + } + else + { + _wall.Shape = WallShape.Corner; + switch (connectionHash) + { + case 1001: + _wall.Orientation = 0; + break; + case 1100: + _wall.Orientation = 1; + break; + case 0110: + _wall.Orientation = 2; + break; + case 0011: + _wall.Orientation = 3; + break; + } + } + break; + + case 3: + _wall.Shape = WallShape.T; + switch (connectionHash) + { + case 1101: + _wall.Orientation = 0; + break; + case 1110: + _wall.Orientation = 1; + break; + case 0111: + _wall.Orientation = 2; + break; + case 1011: + _wall.Orientation = 3; + break; + } + break; + + case 4: + _wall.Shape = WallShape.Cross; + _wall.Orientation = 0; + break; + } + } + + private OctoLevelBuilderTile GetNextTile(Vector3Int direction) + { + Vector3Int nextCoordinates = _infos.Coordinates + direction; + + if (!_references.Map) + { + Debug.LogWarning("[OctoTile] No Map found"); + return null; + } + + if (_references.Map.GetTile(nextCoordinates, out OctoLevelBuilderTile nexTile)) + return nexTile; + + return null; + } + + private void ClearChildren() + { + for (int i = transform.childCount - 1; i >= 0; i--) + { + GameObject instance = transform.GetChild(i).gameObject; + + if (instance != _references.CeilingInstance && + instance != _references.WallInstance && + instance != _references.FloorInstance) + { + DestroyInstance(instance); + } + } + } + + private void RefreshWall() + { + if (!HasWall) + { + DestroyInstance(_references.WallInstance); + _references.WallInstance = null; + return; + } + + RefreshShape(); + + if (!Style) + return; + + GameObject prefab = GetWallPrefab(Style.Wall, _wall.Shape, _wall.Type); + + if (prefab == null) + { + DestroyInstance(_references.WallInstance); + _references.WallInstance = null; + return; + } + + if (IsInstanceCorrespondingToPrefab(_references.WallInstance, prefab)) + { + DestroyInstance(_references.WallInstance); + _references.WallInstance = InstantiatePrefab(prefab, "Wall"); + } + + if (_references.WallInstance != null) + { + float angle = _wall.Orientation * 90f; + _references.WallInstance.transform.localRotation = Quaternion.Euler(0, angle, 0); + } + } + + private GameObject GetWallPrefab(OctoLevelBuilderWallData wallData, WallShape shape, WallType type) + { + if (type == WallType.Door) + return wallData.WallDoor; + if (type == WallType.Window) + return wallData.WallWindow; + + return wallData.GetPrefab(_wall.Orientation, shape); + } + + private void RefreshFloor() + { + if (!HasFloor) + { + DestroyInstance(_references.FloorInstance); + _references.FloorInstance = null; + return; + } + + if (!Style) + return; + + GameObject prefab = Style.Floor.Prefab; + + if (prefab == null) + { + DestroyInstance(_references.FloorInstance); + _references.FloorInstance = null; + return; + } + + if (IsInstanceCorrespondingToPrefab(_references.FloorInstance, prefab)) + { + DestroyInstance(_references.FloorInstance); + _references.FloorInstance = InstantiatePrefab(prefab, "Floor"); + } + } + + private void RefreshCeiling() + { + if (!HasCeiling) + { + DestroyInstance(_references.CeilingInstance); + _references.CeilingInstance = null; + return; + } + + if (!Style) + return; + + GameObject prefab = Style.Ceiling.Prefab; + + if (prefab == null) + { + DestroyInstance(_references.CeilingInstance); + _references.CeilingInstance = null; + return; + } + + if (IsInstanceCorrespondingToPrefab(_references.CeilingInstance, prefab)) + { + DestroyInstance(_references.CeilingInstance); + _references.CeilingInstance = InstantiatePrefab(prefab, "Ceiling"); + } + } + + private bool IsInstanceCorrespondingToPrefab(GameObject instance, GameObject prefab) + { + if (instance == null) + return true; + +#if UNITY_EDITOR + GameObject source = (GameObject)UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(instance); + return source != prefab; +#else + return false; +#endif + } + + private void DestroyInstance(GameObject instance) + { + if (instance != null) + { +#if UNITY_EDITOR + if (!Application.isPlaying) + DestroyImmediate(instance); + else +#endif + Destroy(instance); + instance = null; + } + } + + private GameObject InstantiatePrefab(GameObject prefab, string childName) + { +#if UNITY_EDITOR + GameObject instance = (GameObject)UnityEditor.PrefabUtility.InstantiatePrefab(prefab, transform); + SceneVisibilityManager.instance.DisablePicking(instance, true); +#else + GameObject instance = Instantiate(prefab, transform); +#endif + instance.name = childName; + instance.transform.localPosition = Vector3.zero; + + return instance; + } + + private void GetMap() + { + if (!_references.Map) + _references.Map = GetComponentInParent(); + } + + private bool GetMap(out OctoLevelBuilderMap map) + { + GetMap(); + map = _references.Map; + return map; + } + + private void RequireMapRefresh() + { + _isMapUpToDate = false; + if (GetMap(out OctoLevelBuilderMap map)) + map.RequireMapRefresh(); + } + + private void RegisterToMap() + { + if (GetMap(out OctoLevelBuilderMap map)) + map.RegisterTile(this); + } + + private void UnregisterFromMap() + { + if (GetMap(out OctoLevelBuilderMap map)) + map.UnregisterTile(this); + } + + private void SetName() + { + int x = _infos.Coordinates.x; + int y = _infos.Coordinates.z; + + //string tmpName = "Tile " + (x < 0 ? '-' : '+') + Mathf.Abs(x).ToString().PadLeft(3, '0') + " " + (y < 0 ? '-' : '+') + Mathf.Abs(y).ToString().PadLeft(3, '0'); + string tmpName = "Tile_" + transform.GetSiblingIndex().ToString().PadLeft(3, '0'); + + if (name != tmpName) + name = tmpName; + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderTile.cs.meta b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderTile.cs.meta new file mode 100644 index 00000000..5faa257e --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Level/OctoLevelBuilderTile.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 52265b52f92cb4846aa9f736eb80cfe1 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization.meta b/Packages/OctoCore/Runtime/Scripts/Localization.meta new file mode 100644 index 00000000..8c213930 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10432775657503847bbbaae7825d4195 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLanguages.cs b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLanguages.cs new file mode 100644 index 00000000..677049db --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLanguages.cs @@ -0,0 +1,13 @@ +namespace OctoCore.Localization +{ +public enum OctoLanguages { + English, + French, + //Spanish, + //German, + //Chinese, + //Japanese, + //Korean, +} + +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLanguages.cs.meta b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLanguages.cs.meta new file mode 100644 index 00000000..c69d60f2 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLanguages.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f177e44a5bc17824ab1fa6e1d4b1158c \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalization.cs b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalization.cs new file mode 100644 index 00000000..0149aa24 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalization.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace OctoCore.Localization +{ + /// + /// Localization module for managing text and audio languages. + /// Handles language switching and provides localized text retrieval. + /// + [System.Serializable] + public class OctoLocalization : IOctoModule + { + public OctoLanguages WrittenLanguage; + public OctoLanguages AudioLanguage; + + private Action OnLanguageWrittenChange; + private Action OnLanguageAudioChange; + + private static Dictionary _languagesKey = new Dictionary(); + + public void Init(OctoSettings settings) + { + InitLanguagesKey(); + + // Load written language + + if (settings.Languages.SaveWritten) + { + object language; + Enum.TryParse(typeof(OctoLanguages), OctoCore.Instance.Save.Get(settings.Languages.SaveWritten), true, out language); + if (language == null) + { + language = settings.Languages.Default; + Debug.Log($"[OctoLocalization] Default language settled: {language.ToString()}"); + } + + OctoCore.Instance.Localization.SetLanguageWritten((OctoLanguages)language); + } + + // Load audio language + + if (settings.Languages.SaveAudio) + { + object language; + Enum.TryParse(typeof(OctoLanguages), OctoCore.Instance.Save.Get(settings.Languages.SaveAudio), true, out language); + if (language == null) + language = settings.Languages.Default; + + OctoCore.Instance.Localization.SetLanguageAudio((OctoLanguages)language); + } + + // Callback OctoEvents + + if (OctoEvents.Instance) + OctoEvents.Instance.SetLocalizationInitialized(); + } + + public void Tick() + { + + } + + public void OnSceneChanged(Scene current, Scene next) + { + + } + + public void OnQuit() + { + + } + + public void SetLanguageWritten(OctoLanguages language) { SetLanguage(language, false); } + + public void SetLanguageAudio(OctoLanguages language) { SetLanguage(language, true); } + + private void SetLanguage(OctoLanguages language, bool audio = false) + { + if (audio) + { + OctoCore.Instance.Localization.AudioLanguage = language; + OctoCore.Instance.Save.Set(OctoCore.Instance.Settings.Languages.SaveAudio, language.ToString()); + OnLanguageAudioChange?.Invoke(); + } + else + { + OctoCore.Instance.Localization.WrittenLanguage = language; + OctoCore.Instance.Save.Set(OctoCore.Instance.Settings.Languages.SaveWritten, language.ToString()); + OnLanguageWrittenChange?.Invoke(); + } + } + + public void UnsubscribeOnLanguageWrittenChange(Action handler) + { + SubscribeOnLanguageWrittenChange(handler, false); + } + + public void SubscribeOnLanguageWrittenChange(Action handler, bool subscribe = true) + { + if (subscribe) OnLanguageWrittenChange += handler; + else OnLanguageWrittenChange -= handler; + } + + private static void InitLanguagesKey() + { + foreach (OctoLanguages lang in Enum.GetValues(typeof(OctoLanguages))) + _languagesKey[lang] = lang.ToString(); + } + + public static string GetLocalizedText(OctoLocalizedTextData data, bool audio = false) + { + OctoLanguages language = 0; + if (OctoCore.Instance) + language = audio ? OctoCore.Instance.Localization.AudioLanguage : OctoCore.Instance.Localization.WrittenLanguage; + + return GetLocalizedText(data, language); + } + + public static string GetLocalizedText(OctoLocalizedTextData data, OctoLanguages language) + { + if (data == null || data.Languages == null) + { + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoLocalization] Data is null"); + + return string.Empty; + } + + var dict = data.Languages.Dictionary; + + if (_languagesKey.Count == 0 || !_languagesKey.ContainsKey(language)) + InitLanguagesKey(); + + if (dict != null) + { + if (dict.TryGetValue(_languagesKey[language], out string localizedText) && !string.IsNullOrEmpty(localizedText)) + { + return localizedText; + } + + // Use default if language not found or empty + + if (dict.TryGetValue(_languagesKey[OctoCore.Instance.Settings.Languages.Default], out string fallbackText) && !string.IsNullOrEmpty(fallbackText)) + { + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoLocalization] Use default language for: {data.name}"); + + return fallbackText; + } + } + + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoLocalization] Empty text for: {data.name}"); + + return string.Empty; + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalization.cs.meta b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalization.cs.meta new file mode 100644 index 00000000..c59d7d2f --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalization.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 01370154729dc1344af3e501de37cdcb \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizationProxy.cs b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizationProxy.cs new file mode 100644 index 00000000..79c1c0c2 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizationProxy.cs @@ -0,0 +1,33 @@ +using System; +using UnityEngine; + +namespace OctoCore.Localization +{ +public class OctoLocalizationProxy : MonoBehaviour +{ + public void SetLanguageWritten(string language) + { + if (!OctoCore.Instance) return; + + object value; + Enum.TryParse(typeof(OctoLanguages), language, true, out value); + if (value == null) + value = OctoCore.Instance.Settings.Languages.Default; + + OctoCore.Instance.Localization.SetLanguageWritten((OctoLanguages)value); + } + + public void SetLanguageAudio(string language) + { + if (!OctoCore.Instance) return; + + object value; + Enum.TryParse(typeof(OctoLanguages), language, true, out value); + if (value == null) + value = OctoCore.Instance.Settings.Languages.Default; + + OctoCore.Instance.Localization.SetLanguageAudio((OctoLanguages)value); + } +} + +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizationProxy.cs.meta b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizationProxy.cs.meta new file mode 100644 index 00000000..fd596388 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizationProxy.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 25b90d3d1039b994aa7a8950d3a9b046 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedText.cs b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedText.cs new file mode 100644 index 00000000..73a863b6 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedText.cs @@ -0,0 +1,110 @@ +using System; +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +namespace OctoCore.Localization +{ + public class OctoLocalizedText : MonoBehaviour + { + [SerializeField] OctoLocalizedTextData data; + [SerializeField] Text text; + [SerializeField] TextMeshPro textMeshPro; + [SerializeField] TextMeshProUGUI textMeshProUGUI; + + Action localize; + + #if UNITY_EDITOR + void OnValidate() + { + if (Application.isPlaying) + return; + + bool setDirty = false; + if (!text && !textMeshPro && !textMeshProUGUI) + { + text = GetComponent(); + textMeshPro = GetComponent(); + textMeshProUGUI = GetComponent(); + + if (text || textMeshPro || textMeshProUGUI) + setDirty = true; + } + + if (text && text.transform != transform) + { + text = null; + setDirty = true; + } + + if (textMeshPro && textMeshPro.transform != transform) + { + textMeshPro = null; + setDirty = true; + } + + if (textMeshProUGUI && textMeshProUGUI.transform != transform) + { + textMeshProUGUI = null; + setDirty = true; + } + + if (setDirty) + UnityEditor.EditorUtility.SetDirty(this); + + Localize(); + } + #endif + + void Awake() + { + if (!OctoCore.Instance) + { + Debug.LogWarning($"[OctoLocalizedText] OctoCore.Instance not found"); + return; + } + + Localize(); + OctoCore.Instance.Localization.SubscribeOnLanguageWrittenChange(localize = Localize); + + if (OctoCore.Instance.Development.Log && data) + Debug.Log($"{name} subscribed on language written change"); + } + + void OnDestroy() + { + if (!OctoCore.Instance) return; + + if (localize != null) + { + OctoCore.Instance.Localization.UnsubscribeOnLanguageWrittenChange(localize); + localize = null; + + if (OctoCore.Instance.Development.Log && data) + Debug.Log($"{name} unsubscribed on language written change"); + } + } + + public void Localize() + { + if (!data) return; + + string localizedText = OctoLocalization.GetLocalizedText(data); + + if (text) + { + text.text = localizedText; + } + else if (textMeshPro) + { + textMeshPro.text = localizedText; + } + else if (textMeshProUGUI) + { + textMeshProUGUI.text = localizedText; + //LayoutRebuilder.ForceRebuildLayoutImmediate(textMeshProUGUI.rectTransform); + } + } + } + +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedText.cs.meta b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedText.cs.meta new file mode 100644 index 00000000..8309ae2b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedText.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1023fdbb836c50f48bd4b52575ed3689 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedTextData.cs b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedTextData.cs new file mode 100644 index 00000000..c8e4d68f --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedTextData.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using OctoCore.Save; + +namespace OctoCore.Localization +{ + [CreateAssetMenu(fileName = "text_", menuName = "Octo/Localization/Text", order = 0)] + public class OctoLocalizedTextData : ScriptableObject + { + public OctoSerializableDictionary Languages = new OctoSerializableDictionary(); + + #if UNITY_EDITOR + private void OnValidate() + { + Init(); + } + + public void Init() + { + bool modified = false; + var oldValues = new Dictionary(Languages.Dictionary); + + var newDict = new Dictionary(); + + foreach (string lang in Enum.GetNames(typeof(OctoLanguages))) + { + if (oldValues.TryGetValue(lang, out string oldText)) + { + newDict[lang] = oldText; + } + else + { + newDict[lang] = string.Empty; + modified = true; + } + } + + Languages.Dictionary.Clear(); + foreach (var kvp in newDict) + Languages.Dictionary[kvp.Key] = kvp.Value; + + if (modified) + UnityEditor.EditorUtility.SetDirty(this); + } + #endif + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedTextData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedTextData.cs.meta new file mode 100644 index 00000000..f15b530b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Localization/OctoLocalizedTextData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: cbde7b14ca8fbf24c917c47aa3c51676 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation.meta b/Packages/OctoCore/Runtime/Scripts/Navigation.meta new file mode 100644 index 00000000..5cc2a82b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aeff222c1618a874d9395521097cdf22 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/Data.meta b/Packages/OctoCore/Runtime/Scripts/Navigation/Data.meta new file mode 100644 index 00000000..4471cd3b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d2ab646438037043aad58a513ed2e03 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoSceneData.cs b/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoSceneData.cs new file mode 100644 index 00000000..1d259427 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoSceneData.cs @@ -0,0 +1,38 @@ +using UnityEngine; + +namespace OctoCore.Navigation.Data +{ + /// + /// Scene configuration data. + /// Contains all settings for a specific scene. + /// + [CreateAssetMenu(fileName = "scene_", menuName = "Octo/Scenes/Scene Data", order = 0)] + public class OctoSceneData : ScriptableObject + { + /// + /// Unique identifier for this scene. + /// Automatically set to the asset name. + /// + [OctoReadOnly] public string Id; + + /// + /// Scene name in Build Settings or Addressables. + /// + [Tooltip("Scene name in Build Settings or Addressables")] + public string SceneName; + + /// + /// Enable fade transition when loading this scene. + /// + [Tooltip("Enable fade transition")] + public bool UseFadeTransition = true; + +#if UNITY_EDITOR + void OnValidate() + { + Id = name; + UnityEditor.EditorUtility.SetDirty(this); + } +#endif + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoSceneData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoSceneData.cs.meta new file mode 100644 index 00000000..38211343 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoSceneData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a1f04313388f6a846a9e2a6bfe6e985a \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoTeleporterData.cs b/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoTeleporterData.cs new file mode 100644 index 00000000..0c9de7d6 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoTeleporterData.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace OctoCore.Navigation.Data +{ + /// + /// Teleporter configuration data. + /// Defines teleportation behavior between locations or scenes. + /// + [CreateAssetMenu(fileName = "teleporter_", menuName = "Octo/Scenes/Teleporter Data", order = 1)] + public class OctoTeleporterData : ScriptableObject + { + /// + /// Unique identifier for this teleporter. + /// Automatically set to the asset name. + /// + [OctoReadOnly] public string Id; + + /// + /// Target scene to load (null = stay in current scene). + /// + [Tooltip("Target scene (null = same scene)")] + public OctoSceneData TargetScene; + + /// + /// Set player rotation to match destination teleporter orientation. + /// + [Tooltip("Player orientation after teleport")] + public bool SetPlayerRotation = true; + + /// + /// Enable fade transition during teleport. + /// + [Tooltip("Enable fade transition")] + public bool UseFadeTransition = true; + +#if UNITY_EDITOR + void OnValidate() + { + Id = name; + UnityEditor.EditorUtility.SetDirty(this); + } +#endif + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoTeleporterData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoTeleporterData.cs.meta new file mode 100644 index 00000000..e971b8ea --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/Data/OctoTeleporterData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 01c67a8f36397f441b79c801b74560f1 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoNavigation.cs b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoNavigation.cs new file mode 100644 index 00000000..18c8ea07 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoNavigation.cs @@ -0,0 +1,333 @@ +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.SceneManagement; +using OctoCore.Navigation.Data; + +#if OCTO_ADDRESSABLES +using UnityEngine.AddressableAssets; +using UnityEngine.ResourceManagement.AsyncOperations; +using UnityEngine.ResourceManagement.ResourceProviders; +#endif + +namespace OctoCore.Navigation +{ + /// + /// Scene management module. + /// Handles scene loading, transitions, and teleportation. + /// + [System.Serializable] + public class OctoNavigation : IOctoModule + { + /// + /// Currently loaded scene data. + /// + [OctoReadOnly] public OctoSceneData CurrentScene; + + /// + /// Pending teleporter between scene changes (non-null only during scene transitions). + /// + [OctoReadOnly] public OctoTeleporterData PendingTeleporter; + + /// + /// Invoked when scene loading starts. + /// + public Action OnSceneLoadStarted; + + /// + /// Invoked when scene loading completes. + /// + public Action OnSceneLoadCompleted; + + /// + /// Invoked when teleport starts. + /// + public Action OnTeleportStarted; + + /// + /// Invoked when teleport completes. + /// + public Action OnTeleportCompleted; + + private Coroutine _loadingCoroutine; + private OctoSceneFade _fadeCanvas; + private bool _setPlayerRotation; + + public void Init(OctoSettings settings) + { + // Find current scene in settings + string currentSceneName = SceneManager.GetActiveScene().name; + foreach (var sceneData in settings.Scenes.SceneDatas) + { + if (sceneData.SceneName == currentSceneName) + { + CurrentScene = sceneData; + break; + } + } + + // Create fade canvas + CreateFadeCanvas(); + + if (OctoEvents.Instance) + OctoEvents.Instance.SetScenesInitialized(); + + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoNavigation] Initialized (Addressables: {settings.Scenes.UseAddressables})"); + } + + public void Tick() { } + + public void OnSceneChanged(Scene current, Scene next) + { + // Update CurrentScene reference + if (OctoCore.Instance && OctoCore.Instance.Settings) + { + foreach (var sceneData in OctoCore.Instance.Settings.Scenes.SceneDatas) + { + if (sceneData.SceneName == next.name) + { + CurrentScene = sceneData; + break; + } + } + } + } + + public void OnQuit() { } + + /// + /// Load a scene using OctoSceneData. + /// + public void LoadScene(OctoSceneData sceneData) + { + if (sceneData == null) + { + Debug.LogError("[OctoNavigation] SceneData is null"); + return; + } + + _loadingCoroutine = OctoCore.Instance.StartCoroutine(LoadSceneCoroutine(sceneData)); + } + + /// + /// Teleport using OctoTeleporterData. + /// + public void Teleport(OctoTeleporterData teleporter) + { + if (teleporter == null) + { + Debug.LogError("[OctoNavigation] Teleporter is null"); + return; + } + + OnTeleportStarted?.Invoke(null, teleporter); + + // Same scene teleport + if (teleporter.TargetScene == null || + teleporter.TargetScene == CurrentScene) + { + OctoCore.Instance.StartCoroutine(TeleportSameSceneCoroutine(teleporter)); + } + // Different scene teleport + else + { + OctoCore.Instance.StartCoroutine(TeleportDifferentSceneCoroutine(teleporter)); + } + } + + private IEnumerator LoadSceneCoroutine(OctoSceneData sceneData) + { + OnSceneLoadStarted?.Invoke(sceneData); + + // Get global fade settings + OctoSettings.ScenesSettings.FadeTransitionSettings fadeSettings = OctoCore.Instance.Settings.Scenes.FadeSettings; + + // Fade out + if (sceneData.UseFadeTransition && _fadeCanvas) + { + _fadeCanvas.FadeOut(fadeSettings.FadeOutDuration, fadeSettings.FadeColor); + yield return new WaitForSeconds(fadeSettings.FadeOutDuration); + } + + // Check if using Addressables + bool useAddressables = OctoCore.Instance.Settings.Scenes.UseAddressables; + +#if OCTO_ADDRESSABLES + if (useAddressables) + { + yield return LoadSceneAddressables(sceneData); + } + else +#endif + { + yield return LoadSceneStandard(sceneData); + } + + // Fade in + if (sceneData.UseFadeTransition && _fadeCanvas) + { + _fadeCanvas.FadeIn(fadeSettings.FadeInDuration); + yield return new WaitForSeconds(fadeSettings.FadeInDuration); + } + + OnSceneLoadCompleted?.Invoke(sceneData); + + if (OctoCore.Instance.Development.Log) + Debug.Log($"[OctoNavigation] Scene loaded: {sceneData.SceneName}"); + } + + private IEnumerator LoadSceneStandard(OctoSceneData sceneData) + { + AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneData.SceneName); + yield return asyncLoad; + } + +#if OCTO_ADDRESSABLES + private IEnumerator LoadSceneAddressables(OctoSceneData sceneData) + { + AsyncOperationHandle handle = Addressables.LoadSceneAsync(sceneData.SceneName, LoadSceneMode.Single); + yield return handle; + + if (handle.Status != AsyncOperationStatus.Succeeded) + { + Debug.LogError($"[OctoNavigation] Failed to load scene: {sceneData.SceneName}"); + } + } +#endif + + private IEnumerator TeleportSameSceneCoroutine(OctoTeleporterData teleporter) + { + // Get global fade settings + OctoSettings.ScenesSettings.FadeTransitionSettings fadeSettings = OctoCore.Instance.Settings.Scenes.FadeSettings; + + // Fade out + if (teleporter.UseFadeTransition && _fadeCanvas) + { + _fadeCanvas.FadeOut(fadeSettings.FadeOutDuration, fadeSettings.FadeColor); + yield return new WaitForSeconds(fadeSettings.FadeOutDuration); + } + + // Find target teleporter + OctoTeleporter destination = OctoTeleporter.Find(teleporter); + + if (destination) + { + MovePlayerToTeleporter(destination, teleporter.SetPlayerRotation); + destination.TriggerTeleport(); + } + else + { + Debug.LogError("[OctoNavigation] Target teleporter not found: " + (teleporter ? teleporter.name : "null")); + } + + // Fade in + if (teleporter.UseFadeTransition && _fadeCanvas) + { + _fadeCanvas.FadeIn(fadeSettings.FadeInDuration); + yield return new WaitForSeconds(fadeSettings.FadeInDuration); + } + + OnTeleportCompleted?.Invoke(null, teleporter); + } + + private IEnumerator TeleportDifferentSceneCoroutine(OctoTeleporterData teleporter) + { + // Get global fade settings + OctoSettings.ScenesSettings.FadeTransitionSettings fadeSettings = OctoCore.Instance.Settings.Scenes.FadeSettings; + + // Fade out + if (teleporter.UseFadeTransition && _fadeCanvas) + { + _fadeCanvas.FadeOut(fadeSettings.FadeOutDuration, fadeSettings.FadeColor); + yield return new WaitForSeconds(fadeSettings.FadeOutDuration); + } + + // Store pending teleporter + PendingTeleporter = teleporter; + _setPlayerRotation = teleporter.SetPlayerRotation; + + if (OctoCore.Instance.Settings.Scenes.UseAddressables) + { +#if OCTO_ADDRESSABLES + AsyncOperationHandle handle = Addressables.LoadSceneAsync(teleporter.TargetScene.SceneName, LoadSceneMode.Single); + yield return handle; + + if (handle.Status != AsyncOperationStatus.Succeeded) + { + Debug.LogError("[OctoNavigation] Failed to load scene: " + teleporter.TargetScene.SceneName); + PendingTeleporter = null; + yield break; + } +#endif + } + else + { + AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(teleporter.TargetScene.SceneName); + yield return asyncLoad; + } + + // CompletePendingTeleport will be handled by OctoTeleporters + } + + public void EvaluatePendingTeleport(OctoTeleporter teleporter) + { + if (PendingTeleporter != null && + teleporter != null && + teleporter.TeleporterData != null && + teleporter.TeleporterData == PendingTeleporter) + { + PendingTeleporter = null; + OctoCore.Instance.StartCoroutine(CompletePendingTeleport(teleporter)); + } + } + + private IEnumerator CompletePendingTeleport(OctoTeleporter teleporter) + { + if (teleporter) + { + MovePlayerToTeleporter(teleporter, _setPlayerRotation); + teleporter.TriggerTeleport(); + } + else + { + Debug.LogError("[OctoNavigation] Target teleporter not found in new scene: " + teleporter.name); + } + + // Get global fade settings + OctoSettings.ScenesSettings.FadeTransitionSettings fadeSettings = OctoCore.Instance.Settings.Scenes.FadeSettings; + + // Fade in + if (_fadeCanvas) + { + _fadeCanvas.FadeIn(fadeSettings.FadeInDuration); + yield return new WaitForSeconds(fadeSettings.FadeInDuration); + } + + OnTeleportCompleted?.Invoke(null, teleporter.TeleporterData); + } + + private void MovePlayerToTeleporter(OctoTeleporter teleporter, bool setRotation) + { + if (Components.OctoPlayer.Instance) + { + Components.OctoPlayer.Instance.Teleport(teleporter.transform.position, setRotation ? teleporter.transform.rotation : Components.OctoPlayer.Instance.transform.rotation); + } + else if (OctoTeleporterProxy.Instance) + { + if (setRotation) + OctoTeleporterProxy.Instance.Teleport(teleporter.transform.position, teleporter.transform.rotation); + else + OctoTeleporterProxy.Instance.Teleport(teleporter.transform.position); + } + } + + private void CreateFadeCanvas() + { + GameObject fadeObj = new GameObject("OctoSceneFade"); + GameObject.DontDestroyOnLoad(fadeObj); + _fadeCanvas = fadeObj.AddComponent(); + _fadeCanvas.Initialize(); + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoNavigation.cs.meta b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoNavigation.cs.meta new file mode 100644 index 00000000..1f07c311 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoNavigation.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 52668fd3a36f7d54a9180e2dd4946e37 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneFade.cs b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneFade.cs new file mode 100644 index 00000000..451b0dee --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneFade.cs @@ -0,0 +1,118 @@ +using System.Collections; +using UnityEngine; +using UnityEngine.UI; + +namespace OctoCore.Navigation +{ + /// + /// Handles fade in/out transitions for scene loading and teleportation. + /// + public class OctoSceneFade : MonoBehaviour + { + private Canvas _canvas; + private Image _fadeImage; + + private IEnumerator fadeOutCoroutine; + private IEnumerator fadeInCoroutine; + + /// + /// Initialize the fade canvas and image. + /// + public void Initialize() + { + // Create canvas + _canvas = gameObject.AddComponent(); + _canvas.renderMode = RenderMode.ScreenSpaceOverlay; + _canvas.sortingOrder = 9999; + + gameObject.AddComponent(); + gameObject.AddComponent(); + + // Create fade image + GameObject imageObj = new GameObject("FadeImage"); + imageObj.transform.SetParent(transform); + + _fadeImage = imageObj.AddComponent(); + _fadeImage.color = new Color(0, 0, 0, 0); + + RectTransform rt = _fadeImage.GetComponent(); + rt.anchorMin = Vector2.zero; + rt.anchorMax = Vector2.one; + rt.sizeDelta = rt.anchoredPosition = Vector2.zero; + + _canvas.enabled = false; + } + + /// + /// Fade out to specified color over duration. + /// + public void FadeOut(float duration, Color color) + { + if (fadeOutCoroutine == null) + { + if (fadeInCoroutine != null) + StopCoroutine(fadeInCoroutine); + + StartCoroutine(fadeOutCoroutine = FadeOutCoroutine(duration, color)); + } + } + + /// + /// Fade in from current color to transparent over duration. + /// + public void FadeIn(float duration) + { + if (fadeInCoroutine == null) + { + if (fadeOutCoroutine != null) + StopCoroutine(fadeOutCoroutine); + + StartCoroutine(fadeInCoroutine = FadeInCoroutine(duration)); + } + } + + private IEnumerator FadeOutCoroutine(float duration, Color color) + { + _canvas.enabled = true; + + Color startColor = new Color(color.r, color.g, color.b, 0); + Color endColor = new Color(color.r, color.g, color.b, 1); + + for (float t = 0; t < duration; t += Time.unscaledDeltaTime) + { + float normalizedTime = Mathf.Clamp01(t / duration); + _fadeImage.color = Color.Lerp(startColor, endColor, normalizedTime); + yield return new WaitForEndOfFrame(); + } + + _fadeImage.color = endColor; + + fadeOutCoroutine = null; + } + + /// + /// Fade in from current color to transparent over duration. + /// + private IEnumerator FadeInCoroutine(float duration) + { + Color startColor = _fadeImage.color; + + if (startColor != Color.clear) + { + Color endColor = new Color(startColor.r, startColor.g, startColor.b, 0); + + for (float t = 0; t < duration; t += Time.unscaledDeltaTime) + { + float normalizedTime = Mathf.Clamp01(t / duration); + _fadeImage.color = Color.Lerp(startColor, endColor, normalizedTime); + yield return new WaitForEndOfFrame(); + } + + _fadeImage.color = endColor; + _canvas.enabled = false; + } + + fadeInCoroutine = null; + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneFade.cs.meta b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneFade.cs.meta new file mode 100644 index 00000000..fc21d08b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneFade.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 53bf408fb989ba342a38b073dd1dafd1 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneTrigger.cs b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneTrigger.cs new file mode 100644 index 00000000..b15894e5 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneTrigger.cs @@ -0,0 +1,37 @@ +using UnityEngine; +using OctoCore.Navigation.Data; + +namespace OctoCore.Navigation +{ + /// + /// Scene trigger component. + /// Links OctoWorldEvent to the scene loading system. + /// Call LoadScene() from OctoWorldEvent to load a scene. + /// + public class OctoSceneTrigger : MonoBehaviour + { + [SerializeField, Tooltip("Scene data to load")] + private OctoSceneData _sceneData; + + /// + /// Load the configured scene. + /// This method should be called from OctoWorldEvent. + /// + public void LoadScene() + { + if (!OctoCore.Instance) + { + Debug.LogError("[OctoSceneTrigger] OctoCore instance not found"); + return; + } + + if (_sceneData == null) + { + Debug.LogError("[OctoSceneTrigger] SceneData is null"); + return; + } + + OctoCore.Instance.Navigation.LoadScene(_sceneData); + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneTrigger.cs.meta b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneTrigger.cs.meta new file mode 100644 index 00000000..5efbe8fd --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoSceneTrigger.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 67296e1c23d8b3645add1d503a4b3a3f \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporter.cs b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporter.cs new file mode 100644 index 00000000..b8389fc5 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporter.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; +using OctoCore.Navigation.Data; + +namespace OctoCore.Navigation +{ + /// + /// Teleporter destination component. + /// Marks a position as a valid teleport arrival point. + /// + public class OctoTeleporter : MonoBehaviour + { + private static List Teleporters = new List(); + + [SerializeField, Tooltip("Teleporter data identifying this destination")] + private OctoTeleporterData _teleporterData; + + [SerializeField, Tooltip("Event triggered when player teleports to this location")] + private UnityEvent _onTeleport; + + /// + /// Teleporter data for this destination. + /// + public OctoTeleporterData TeleporterData => _teleporterData; + + /// + /// Find a teleporter by its data reference. + /// + public static OctoTeleporter Find(OctoTeleporterData data) + { + if (data == null) + return null; + + foreach (var teleporter in Teleporters) + { + if (teleporter._teleporterData == data) + return teleporter; + } + + return null; + } + + void OnEnable() + { + if (!Teleporters.Contains(this)) + Teleporters.Add(this); + + if (OctoCore.Instance) + OctoCore.Instance.Navigation.EvaluatePendingTeleport(this); + } + + void OnDisable() + { + Teleporters.Remove(this); + } + + /// + /// Trigger the teleport event. + /// Called by OctoNavigation when player arrives. + /// + public void TriggerTeleport() + { + _onTeleport?.Invoke(); + + if (OctoCore.Instance && OctoCore.Instance.Development.Log) + Debug.Log("[OctoTeleporter] Teleported to: " + (_teleporterData ? _teleporterData.name : "Unknown")); + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporter.cs.meta b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporter.cs.meta new file mode 100644 index 00000000..d30018aa --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7b476baeb59f80b42aaa56a0901de859 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterProxy.cs b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterProxy.cs new file mode 100644 index 00000000..dd5468ff --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterProxy.cs @@ -0,0 +1,42 @@ +using UnityEngine; +using UnityEngine.Events; + +namespace OctoCore.Navigation +{ + public class OctoTeleporterProxy : MonoBehaviour + { + public static OctoTeleporterProxy Instance { get; private set; } + + [SerializeField] private UnityEvent _onPreTeleport; + [SerializeField] private UnityEvent _setPositon; + [SerializeField] private UnityEvent _setRotation; + [SerializeField] private UnityEvent _onPostTeleport; + + void OnEnable() + { + if (Instance != null) + { + Debug.LogWarning("Only one OctoTeleporterProxy per scene is supported"); + return; + } + Instance = this; + } + + void OnDisable() + { + if (Instance == this) + Instance = null; + } + + public void Teleport(Vector3 position) { Teleport(position, Quaternion.identity, false); } + + public void Teleport(Vector3 position, Quaternion rotation, bool setRotation = true) + { + _onPreTeleport?.Invoke(false); + _setPositon?.Invoke(position); + if (setRotation) + _setRotation?.Invoke(rotation); + _onPostTeleport?.Invoke(true); + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterProxy.cs.meta b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterProxy.cs.meta new file mode 100644 index 00000000..107ddb68 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterProxy.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2f788fcf1ffcc3342b6e7a87661a4262 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterTrigger.cs b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterTrigger.cs new file mode 100644 index 00000000..41bfb9ea --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterTrigger.cs @@ -0,0 +1,37 @@ +using UnityEngine; +using OctoCore.Navigation.Data; + +namespace OctoCore.Navigation +{ + /// + /// Teleporter trigger component. + /// Links OctoWorldEvent to the teleportation system. + /// Call Teleport() from OctoWorldEvent to initiate teleportation. + /// + public class OctoTeleporterTrigger : MonoBehaviour + { + [SerializeField, Tooltip("Teleporter to teleport to")] + private OctoTeleporterData _teleporter; + + /// + /// Initiate teleportation to the configured teleporter. + /// This method should be called from OctoWorldEvent. + /// + public void Teleport() + { + if (!OctoCore.Instance) + { + Debug.LogError("[OctoTeleporterTrigger] OctoCore instance not found"); + return; + } + + if (_teleporter == null) + { + Debug.LogError("[OctoTeleporterTrigger] Teleporter is null"); + return; + } + + OctoCore.Instance.Navigation.Teleport(_teleporter); + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterTrigger.cs.meta b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterTrigger.cs.meta new file mode 100644 index 00000000..75600db5 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Navigation/OctoTeleporterTrigger.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 981114d2a43791f40bc46a5ae85cc02d \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/OctoCore.cs b/Packages/OctoCore/Runtime/Scripts/OctoCore.cs new file mode 100644 index 00000000..8a87075b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/OctoCore.cs @@ -0,0 +1,136 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace OctoCore +{ + /// + /// Main entry point for the OctoCore framework. + /// Manages all modules and coordinates their lifecycle. + /// + [DefaultExecutionOrder(-100)] + public class OctoCore : MonoBehaviour + { + /// + /// Singleton instance of OctoCore. + /// + public static OctoCore Instance { get; private set; } + + private List _modules = new(); + + /// + /// Global settings for the OctoCore framework. + /// + public OctoSettings Settings; + + [SerializeField] private Platform.OctoPlatform _platform = new(); + [SerializeField] private Save.OctoSave _save = new(); + [SerializeField] private Inputs.OctoInputs _inputs = new(); + [SerializeField] private Localization.OctoLocalization _localization = new(); + [SerializeField] private UI.OctoUI _ui = new(); + [SerializeField] private Navigation.OctoNavigation _navigation = new(); + [SerializeField] private Development.OctoDevelopment _development = new(); + + /// + /// Platform detection module. + /// + public Platform.OctoPlatform Platform => _platform; + + /// + /// Save system module. + /// + public Save.OctoSave Save => _save; + + /// + /// Input management module. + /// + public Inputs.OctoInputs Inputs => _inputs; + + /// + /// Localization module for text and audio. + /// + public Localization.OctoLocalization Localization => _localization; + + /// + /// UI management module. + /// + public UI.OctoUI UI => _ui; + + /// + /// Scenes management module. + /// + public Navigation.OctoNavigation Navigation => _navigation; + + /// + /// Development and debugging module. + /// + public Development.OctoDevelopment Development => _development; + + void Awake() + { + if (Instance == null) + { + Instance = this; + Debug.Log($"[OctoCore] OctoCore Instantiated"); + DontDestroyOnLoad(gameObject); + } + else + { + Destroy(gameObject); + return; + } + + RegisterModule(_platform); + RegisterModule(_save); + RegisterModule(_inputs); + RegisterModule(_localization); + RegisterModule(_ui); + RegisterModule(_navigation); + RegisterModule(_development); + + foreach (IOctoModule module in _modules) + { + module.Init(Settings); + } + } + + void RegisterModule(IOctoModule module) + { + _modules.Add(module); + } + + void OnEnable() + { + SceneManager.activeSceneChanged += OnSceneChanged; + } + + void OnDisable() + { + SceneManager.activeSceneChanged -= OnSceneChanged; + } + + void Update() + { + foreach (IOctoModule module in _modules) + { + module.Tick(); + } + } + + void OnApplicationQuit() + { + foreach (IOctoModule module in _modules) + { + module.OnQuit(); + } + } + + void OnSceneChanged(Scene oldScene, Scene newScene) + { + foreach (IOctoModule module in _modules) + { + module.OnSceneChanged(oldScene, newScene); + } + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/OctoCore.cs.meta b/Packages/OctoCore/Runtime/Scripts/OctoCore.cs.meta new file mode 100644 index 00000000..fd00c4b6 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/OctoCore.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a699f971e869ebf46915f66af5dc8102 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/OctoEvents.cs b/Packages/OctoCore/Runtime/Scripts/OctoEvents.cs new file mode 100644 index 00000000..9283a97d --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/OctoEvents.cs @@ -0,0 +1,93 @@ +using UnityEngine; +using UnityEngine.Events; + +namespace OctoCore +{ + [DefaultExecutionOrder(-101)] + public class OctoEvents : MonoBehaviour + { + public static OctoEvents Instance { get; private set; } + + [SerializeField] private UnityEvent _onPlatformInitialized; + [SerializeField] private UnityEvent _onSaveInitialized; + [SerializeField] private UnityEvent _onInputsInitialized; + [SerializeField] private UnityEvent _onLocalizationInitialized; + [SerializeField] private UnityEvent _onScenesInitialized; + [SerializeField] private UnityEvent _onUiInitialized; + [SerializeField] private UnityEvent _onOctoCoreInitialized; + + bool _platformInitialized; + bool _saveInitialized; + bool _inputsInitialized; + bool _localizationInitialized; + bool _scenesInitialized; + bool _uiInitialized; + + void Awake() + { + Instance = this; + } + + void OnDestroy() + { + if (Instance == this) + Instance = null; + } + + private void SetOctoCoreInitialized() + { + if (_platformInitialized && + _saveInitialized && + _inputsInitialized && + _localizationInitialized && + _scenesInitialized && + _uiInitialized) + { + Debug.Log($"[OctoCore] OctoCore Initialized"); + _onOctoCoreInitialized?.Invoke(); + } + } + + public void SetPlatformInitialized() + { + _onPlatformInitialized?.Invoke(); + _platformInitialized = true; + SetOctoCoreInitialized(); + } + + public void SetSaveInitialized() + { + _onSaveInitialized?.Invoke(); + _saveInitialized = true; + SetOctoCoreInitialized(); + } + + public void SetInputsInitialized() + { + _onInputsInitialized?.Invoke(); + _inputsInitialized = true; + SetOctoCoreInitialized(); + } + + public void SetLocalizationInitialized() + { + _onLocalizationInitialized?.Invoke(); + _localizationInitialized = true; + SetOctoCoreInitialized(); + } + + public void SetScenesInitialized() + { + _onScenesInitialized?.Invoke(); + _scenesInitialized = true; + SetOctoCoreInitialized(); + } + + public void SetUiInitialized() + { + _onUiInitialized?.Invoke(); + _uiInitialized = true; + SetOctoCoreInitialized(); + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/OctoEvents.cs.meta b/Packages/OctoCore/Runtime/Scripts/OctoEvents.cs.meta new file mode 100644 index 00000000..24246895 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/OctoEvents.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 86cab3031ee84484985b55a4e37af012 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/OctoSettings.cs b/Packages/OctoCore/Runtime/Scripts/OctoSettings.cs new file mode 100644 index 00000000..dfcc16ca --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/OctoSettings.cs @@ -0,0 +1,699 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using TMPro; +using UnityEngine; +using OctoCore.Inputs; + +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if ENABLE_INPUT_SYSTEM +using UnityEngine.InputSystem; +#endif + +namespace OctoCore +{ + /// + /// Global settings for the OctoCore framework. + /// Configure save system, input mappings, localization, and UI settings. + /// + [CreateAssetMenu(fileName = "OctoSettings", menuName = "Octo/Settings Global", order = 0)] + public class OctoSettings : ScriptableObject + { + /// + /// Save system configuration. + /// + [System.Serializable] + public class SaveSettings + { + /// + /// All boolean save data keys in the project. + /// + public global::OctoCore.Save.Data.OctoDataBool[] Booleans; + + /// + /// All integer save data keys in the project. + /// + public global::OctoCore.Save.Data.OctoDataInt[] Integers; + + /// + /// All float save data keys in the project. + /// + public global::OctoCore.Save.Data.OctoDataFloat[] Floats; + + /// + /// All string save data keys in the project. + /// + public global::OctoCore.Save.Data.OctoDataString[] Strings; + + /// + /// All vector save data keys in the project. + /// + public global::OctoCore.Save.Data.OctoDataVector[] Vectors; + } + + /// + /// Input mapping configuration. + /// + [System.Serializable] + public class MappingSettings + { + [System.Serializable] + public class Icon + { + public bool UseName = true; + public Sprite Sprite; + } + + [System.Serializable] + public class ActionData + { + [HideInInspector] + public string Name; + + [HideInInspector] + public string MapName; + + public OctoActions Action; + +#if ENABLE_INPUT_SYSTEM + [Tooltip("Reference to the InputAction from the asset")] + public InputActionReference Reference; +#endif + + public Icon Icon; + + public ActionData(OctoActions action, string name, string mapName) + { + Action = action; + Name = name; + MapName = mapName; + } + } + + /// + /// Reference Input Action Asset. + /// +#if ENABLE_INPUT_SYSTEM + [Tooltip("Assign your Input Action Asset here")] + public InputActionAsset InputActionAsset; +#endif + + /// + /// Generated Actions. + /// + [Tooltip("Actions (generated automatically)")] + public List Actions = new List(); + + /// + /// Get action map name for a specific action. + /// + public string GetActionMapName(OctoActions action) + { + foreach (var actionData in Actions) + { + if (actionData.Action == action) + return actionData.MapName; + } + return null; + } + +#if ENABLE_INPUT_SYSTEM && UNITY_EDITOR + /// + /// Get InputActionReference for a specific action. + /// + public InputActionReference GetReference(OctoActions action) + { + foreach (var actionData in Actions) + { + if (actionData.Action == action) + return actionData.Reference; + } + return null; + } +#endif + } + + /// + /// Language configuration. + /// + [System.Serializable] + public class LanguagesSettings + { + /// + /// Font override settings for specific languages. + /// + [System.Serializable] + public class Override + { + [HideInInspector] public string Name; + + /// + /// The language this override applies to. + /// + public Localization.OctoLanguages Language; + + /// + /// Custom font for this language. + /// + public TMP_FontAsset Font; + + /// + /// Size multiplier for this language's text. + /// + public float SizeMultiplier = 1; + } + + /// + /// Default language to use when no preference is set. + /// + public Localization.OctoLanguages Default; + + /// + /// Save data key for written language preference. + /// + public global::OctoCore.Save.Data.OctoDataString SaveWritten; + + /// + /// Save data key for audio language preference. + /// + public global::OctoCore.Save.Data.OctoDataString SaveAudio; + + /// + /// Font overrides for specific languages. + /// + public Override[] Overrides; + } + + /// + /// Configuration for UI scaling. + /// + [System.Serializable] + public class UiSettings + { + [System.Serializable] + public class Sprites + { + public Sprite DefaultButton; + } + + /// + /// Reference screen size for UI scaling calculations. + /// + public Vector2Int ReferenceSize = new Vector2Int(1920, 1080); + + /// + /// Reference screen size for UI scaling calculations. + /// + public Sprites IconsBackground; + } + + /// + /// Scene management configuration. + /// + [System.Serializable] + public class ScenesSettings + { + /// + /// Fade transition settings. + /// + [System.Serializable] + public class FadeTransitionSettings + { + /// + /// Fade in duration in seconds. + /// + [Tooltip("Fade in duration")] + public float FadeInDuration = 0.5f; + + /// + /// Fade out duration in seconds. + /// + [Tooltip("Fade out duration")] + public float FadeOutDuration = 0.5f; + + /// + /// Fade color. + /// + [Tooltip("Fade color")] + public Color FadeColor = Color.black; + } + + /// + /// All scene data in the project. + /// + [Tooltip("All scene data in the project")] + public Navigation.Data.OctoSceneData[] SceneDatas; + + /// + /// Use Addressables for scene loading. + /// Requires OCTO_ADDRESSABLES scripting define symbol. + /// + [Tooltip("Use Addressables for scene loading (requires OCTO_ADDRESSABLES define)")] + public bool UseAddressables = false; + + /// + /// Global fade transition settings. + /// + [Tooltip("Global fade transition settings")] + public FadeTransitionSettings FadeSettings = new FadeTransitionSettings(); + } + + /// + /// Save system settings. + /// + [OctoReadOnly] public SaveSettings Save; + + /// + /// Input mapping settings. + /// + public MappingSettings Mapping; + + /// + /// Language system settings. + /// + public LanguagesSettings Languages; + + /// + /// Scene management settings. + /// + public ScenesSettings Scenes; + + /// + /// UI settings. + /// + public UiSettings Ui; + + + #region DATAS SET + +#if UNITY_EDITOR + void OnValidate() + { + Init(); + } + + /// + /// Initializes and validates settings in the Unity Editor. + /// + public void Init() + { + // Update language override names + foreach (LanguagesSettings.Override langOverride in Languages.Overrides) + { + langOverride.Name = langOverride.Language.ToString(); + } + } + + /// + /// Scans the project for all OctoData assets and populates the Save settings. + /// + public void GetAllDatas() + { + List booleans = new(); + List integers = new(); + List floats = new(); + List strings = new(); + List vectors = new(); + + string[] guids = UnityEditor.AssetDatabase.FindAssets("t:" + typeof(global::OctoCore.Save.Data.OctoData).Name); + + for (int i = 0; i < guids.Length; i++) + { + string assetPath = UnityEditor.AssetDatabase.GUIDToAssetPath(guids[i]); + global::OctoCore.Save.Data.OctoData data = (global::OctoCore.Save.Data.OctoData)UnityEditor.AssetDatabase.LoadAssetAtPath(assetPath, typeof(global::OctoCore.Save.Data.OctoData)); + + if (data) + { + data.Id = data.name; + UnityEditor.EditorUtility.SetDirty(data); + + if (data is global::OctoCore.Save.Data.OctoDataBool) + booleans.Add((global::OctoCore.Save.Data.OctoDataBool)data); + + if (data is global::OctoCore.Save.Data.OctoDataInt) + integers.Add((global::OctoCore.Save.Data.OctoDataInt)data); + + if (data is global::OctoCore.Save.Data.OctoDataFloat) + floats.Add((global::OctoCore.Save.Data.OctoDataFloat)data); + + if (data is global::OctoCore.Save.Data.OctoDataString) + strings.Add((global::OctoCore.Save.Data.OctoDataString)data); + + if (data is global::OctoCore.Save.Data.OctoDataVector) + vectors.Add((global::OctoCore.Save.Data.OctoDataVector)data); + } + } + + Save.Booleans = booleans.ToArray(); + Save.Integers = integers.ToArray(); + Save.Floats = floats.ToArray(); + Save.Strings = strings.ToArray(); + Save.Vectors = vectors.ToArray(); + + UnityEditor.EditorUtility.SetDirty(this); + UnityEditor.AssetDatabase.SaveAssets(); + } + + /// + /// Scans the project for all OctoSceneData assets and populates the Scenes settings. + /// + public void GetAllSceneDatas() + { + List sceneDatas = new(); + + string[] guids = UnityEditor.AssetDatabase.FindAssets("t:" + typeof(Navigation.Data.OctoSceneData).Name); + + for (int i = 0; i < guids.Length; i++) + { + string assetPath = UnityEditor.AssetDatabase.GUIDToAssetPath(guids[i]); + Navigation.Data.OctoSceneData sceneData = (Navigation.Data.OctoSceneData)UnityEditor.AssetDatabase.LoadAssetAtPath(assetPath, typeof(Navigation.Data.OctoSceneData)); + + if (sceneData) + { + sceneData.Id = sceneData.name; + UnityEditor.EditorUtility.SetDirty(sceneData); + + sceneDatas.Add(sceneData); + } + } + + Scenes.SceneDatas = sceneDatas.ToArray(); + + UnityEditor.EditorUtility.SetDirty(this); + UnityEditor.AssetDatabase.SaveAssets(); + + Debug.Log("[OctoSettings] Found " + sceneDatas.Count + " Scene Datas"); + } +#endif + +#if ENABLE_INPUT_SYSTEM && UNITY_EDITOR + private static string GetActionsFilePath() + { + // Find OctoInputs.cs to locate the package + string[] guids = AssetDatabase.FindAssets("OctoInputs t:script"); + foreach (string guid in guids) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + if (path.Contains("/Inputs/OctoInputs.cs")) + { + // Found it! Same directory + string directory = Path.GetDirectoryName(path); + return Path.Combine(directory, "OctoActions.cs").Replace("\\", "/"); + } + } + + // Fallback + return "Assets/OctoCore/Generated/OctoActions.cs"; + } + + private const string ActionsBackupFile = "Assets/OctoCore/Editor/OctoActions.json"; + + public void GenerateInputs() + { + Debug.Log("[OctoCore] GenerateInputs() called"); + + if (Mapping.InputActionAsset == null) + { + EditorUtility.DisplayDialog("Error", "Please assign an Input Actions asset first!", "OK"); + return; + } + + string actionsFile = GetActionsFilePath(); + + Debug.Log($"[OctoCore] Input Action Asset: {Mapping.InputActionAsset.name}"); + Debug.Log($"[OctoCore] Target file: {actionsFile}"); + + // Ensure directory exists + string directory = Path.GetDirectoryName(actionsFile); + if (!Directory.Exists(directory)) + { + Debug.Log($"[OctoCore] Creating directory: {directory}"); + Directory.CreateDirectory(directory); + } + + Debug.Log("[OctoCore] Calling GenerateActionsEnum..."); + + // Generate enum file + GenerateActionsEnum(Mapping.InputActionAsset, actionsFile); + + Debug.Log("[OctoCore] GenerateActionsEnum completed"); + + // Refresh to compile new enums + AssetDatabase.Refresh(); + + EditorUtility.DisplayProgressBar("Generating Inputs", "Waiting for compilation...", 0.5f); + + // Wait a bit longer for compilation with multiple delays + EditorApplication.delayCall += () => + { + EditorApplication.delayCall += () => + { + EditorApplication.delayCall += () => + { + EditorUtility.ClearProgressBar(); + + // Populate mappings after compilation + PopulateMappings(); + + // Mark data as dirty to save changes + EditorUtility.SetDirty(this); + + EditorUtility.DisplayDialog( + "Success", + $"Input enums generated successfully!\n\n" + + $"Generated in: {actionsFile}\n" + + $"Backup saved in: {ActionsBackupFile}\n" + + $"Total Actions: {CountTotalActions(Mapping.InputActionAsset)}\n\n" + + $"Note: Backup is automatically restored after package updates!", + "OK" + ); + }; + }; + }; + } + + public void PopulateMappings() + { + Mapping.Actions.Clear(); + + foreach (var map in Mapping.InputActionAsset.actionMaps) + { + string mapName = CleanName(map.name); + + foreach (var action in map.actions) + { + string actionName = CleanName(action.name); + string fullName = $"{mapName}_{actionName}"; + + if (!System.Enum.TryParse(fullName, out var actionEnum)) + { + Debug.LogWarning($"[OctoSettings] Could not parse action: {fullName}"); + continue; + } + + // Create action data with map name + var actionData = new MappingSettings.ActionData(actionEnum, action.name, map.name); + + // Find InputActionReference in the asset's sub-assets + actionData.Reference = FindInputActionReferenceInAsset(Mapping.InputActionAsset, action); + + if (actionData.Reference == null) + { + Debug.LogWarning($"[OctoSettings] No InputActionReference found for {map.name}/{action.name}"); + } + + Mapping.Actions.Add(actionData); + } + } + + EditorUtility.SetDirty(this); + AssetDatabase.SaveAssets(); + } + + private InputActionReference FindInputActionReferenceInAsset(InputActionAsset asset, InputAction action) + { + // Get the asset path + string assetPath = AssetDatabase.GetAssetPath(asset); + + // Load all sub-assets (InputActionReference are stored as sub-assets) + var allAssets = AssetDatabase.LoadAllAssetsAtPath(assetPath); + + foreach (var subAsset in allAssets) + { + if (subAsset is InputActionReference reference) + { + if (reference.action == action) + { + return reference; + } + } + } + + return null; + } + + public int CountTotalActions(InputActionAsset asset) + { + int count = 0; + foreach (var map in asset.actionMaps) + { + count += map.actions.Count; + } + return count; + } + + private void GenerateActionsEnum(InputActionAsset inputActions, string outputFile) + { + Debug.Log($"[OctoCore] GenerateActionsEnum started for: {inputActions.name}"); + + StringBuilder sb = new StringBuilder(); + List backupData = new List(); + + sb.AppendLine("// ═══════════════════════════════════════════════════════════════════════════"); + sb.AppendLine("// AUTO-GENERATED FILE - DO NOT EDIT MANUALLY"); + sb.AppendLine("// ═══════════════════════════════════════════════════════════════════════════"); + sb.AppendLine("// Generated by OctoSettings"); + sb.AppendLine("// Backup saved in: Assets/OctoCore/Generated/OctoActions.json"); + sb.AppendLine("// To regenerate: OctoSettings > Mapping > Click 'Generate Inputs'"); + sb.AppendLine($"// Generated from: {inputActions.name}"); + sb.AppendLine($"// Generated on: {System.DateTime.Now:yyyy-MM-dd HH:mm:ss}"); + sb.AppendLine("// ═══════════════════════════════════════════════════════════════════════════"); + sb.AppendLine(); + sb.AppendLine("namespace OctoCore.Inputs"); + sb.AppendLine("{"); + sb.AppendLine(" /// "); + sb.AppendLine(" /// Actions from Unity Input Actions."); + sb.AppendLine($" /// Generated from: {inputActions.name}"); + sb.AppendLine(" /// Format: ActionMap_ActionName"); + sb.AppendLine(" /// Values are stable hashes to prevent serialization issues when regenerating."); + sb.AppendLine(" /// "); + sb.AppendLine(" public enum OctoActions"); + sb.AppendLine(" {"); + + bool first = true; + foreach (var map in inputActions.actionMaps) + { + string mapName = CleanName(map.name); + + foreach (var action in map.actions) + { + string actionName = CleanName(action.name); + string fullName = $"{mapName}_{actionName}"; + + // Generate stable hash from name + int hash = GetStableHash(fullName); + + // Save to backup data + backupData.Add(new ActionBackupData + { + Name = fullName, + Hash = hash, + MapName = map.name, + ActionName = action.name + }); + + if (!first) + sb.AppendLine(","); + + sb.AppendLine($" /// {map.name} > {action.name}"); + sb.Append($" {fullName} = {hash}"); + + first = false; + } + } + sb.AppendLine(); + + sb.AppendLine(" }"); + sb.AppendLine("}"); + + // Write enum file + File.WriteAllText(outputFile, sb.ToString()); + Debug.Log($"[OctoCore] OctoActions.cs written to: {outputFile}"); + Debug.Log($"[OctoCore] File contains {backupData.Count} actions"); + + // Force Unity to see the change + AssetDatabase.ImportAsset(outputFile, ImportAssetOptions.ForceUpdate); + + // Save backup JSON + SaveActionsBackup(backupData); + } + + [System.Serializable] + private class ActionBackupData + { + public string Name; + public int Hash; + public string MapName; + public string ActionName; + } + + [System.Serializable] + private class ActionsBackup + { + public string GeneratedFrom; + public string GeneratedOn; + public List Actions; + } + + private void SaveActionsBackup(List actions) + { + // Ensure directory exists + string directory = Path.GetDirectoryName(ActionsBackupFile); + if (!Directory.Exists(directory)) + { + Directory.CreateDirectory(directory); + } + + var backup = new ActionsBackup + { + GeneratedFrom = Mapping.InputActionAsset.name, + GeneratedOn = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), + Actions = actions + }; + + string json = JsonUtility.ToJson(backup, true); + File.WriteAllText(ActionsBackupFile, json); + + Debug.Log($"[OctoCore] Actions backup saved to: {ActionsBackupFile}"); + } + + /// + /// Generate a stable hash from a string (same string always gives same hash). + /// + private int GetStableHash(string str) + { + unchecked + { + int hash1 = 5381; + int hash2 = hash1; + + for (int i = 0; i < str.Length && str[i] != '\0'; i += 2) + { + hash1 = ((hash1 << 5) + hash1) ^ str[i]; + if (i == str.Length - 1 || str[i + 1] == '\0') + break; + hash2 = ((hash2 << 5) + hash2) ^ str[i + 1]; + } + + return hash1 + (hash2 * 1566083941); + } + } + + private string CleanName(string name) + { + name = name.Replace(" ", "_").Replace("-", "_"); + name = new string(name.Where(c => char.IsLetterOrDigit(c) || c == '_').ToArray()); + if (char.IsDigit(name[0])) + name = "_" + name; + return name; + } +#endif + + #endregion + + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/OctoSettings.cs.meta b/Packages/OctoCore/Runtime/Scripts/OctoSettings.cs.meta new file mode 100644 index 00000000..c7e4a0cf --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/OctoSettings.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c12f834718fa7c2479f8a954db0682ec \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Platform.meta b/Packages/OctoCore/Runtime/Scripts/Platform.meta new file mode 100644 index 00000000..fb2db9be --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Platform.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ada930a247a58140afa00be2976218f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatform.cs b/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatform.cs new file mode 100644 index 00000000..662030d7 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatform.cs @@ -0,0 +1,237 @@ +using System; +using UnityEngine; +using UnityEngine.SceneManagement; +#if ENABLE_INPUT_SYSTEM +using UnityEngine.InputSystem; +using UnityEngine.InputSystem.Controls; +#endif + +namespace OctoCore.Platform +{ + /// + /// Platform detection and input device management module. + /// Detects the current platform and whether a controller is connected. + /// Compatible with both old and new Unity Input System. + /// + [System.Serializable] + public class OctoPlatform : IOctoModule + { + [SerializeField, OctoReadOnly] private OctoPlatforms _current; + [SerializeField, OctoReadOnly] private bool _controller; + + /// + /// The current platform the game is running on. + /// + public OctoPlatforms Current => _current; + + /// + /// Whether a controller is currently being used (true) or keyboard/mouse (false). + /// Only relevant on Standalone platform. + /// + public bool Controller => _controller; + + /// + /// Event invoked when the input device changes between controller and keyboard/mouse. + /// + public Action OnInputDeviceChange; + + private bool _initialized; + + public void Init(OctoSettings settings) + { +#if UNITY_EDITOR + _current = OctoPlatforms.Standalone; + _controller = false; +#elif UNITY_GAMECORE_XBOXONE + _current = OctoPlatforms.XboxOne; + _controller = true; +#elif UNITY_GAMECORE_SCARLETT + _current = OctoPlatforms.XboxSeries; + _controller = true; +#elif UNITY_PS4 + _current = OctoPlatforms.PS4; + _controller = true; +#elif UNITY_PS5 + _current = OctoPlatforms.PS5; + _controller = true; +#elif UNITY_SWITCH + _current = OctoPlatforms.Switch; + _controller = true; +#elif UNITY_ANDROID + _current = OctoPlatforms.Android; + _controller = false; +#elif UNITY_IOS + _current = OctoPlatforms.iOS; + _controller = false; +#else + _current = OctoPlatforms.Standalone; + _controller = false; +#endif + + _initialized = true; + + // Callback OctoEvents + + if (OctoEvents.Instance) + OctoEvents.Instance.SetPlatformInitialized(); + } + + public void Tick() + { + DetectInputDeviceChange(); + } + + public void OnSceneChanged(Scene current, Scene next) + { + } + + public void OnQuit() + { + } + + /// + /// Detects changes between controller and keyboard/mouse input on Standalone platform. + /// Works with both old Input Manager and new Input System. + /// + private void DetectInputDeviceChange() + { + if (!_initialized || _current != OctoPlatforms.Standalone) + return; + +#if ENABLE_INPUT_SYSTEM + DetectInputDeviceChange_NewSystem(); +#else + DetectInputDeviceChange_OldSystem(); +#endif + } + +#if ENABLE_INPUT_SYSTEM + /// + /// Input detection using the new Input System. + /// + private void DetectInputDeviceChange_NewSystem() + { + bool usingController = false; + bool usingKeyboardOrMouse = false; + + // Check for keyboard input + var keyboard = Keyboard.current; + if (keyboard != null && keyboard.anyKey.wasPressedThisFrame) + { + usingKeyboardOrMouse = true; + } + + // Check for mouse input + var mouse = Mouse.current; + if (mouse != null) + { + Vector2 mouseDelta = mouse.delta.ReadValue(); + if (mouseDelta.sqrMagnitude > 0.01f) + { + usingKeyboardOrMouse = true; + } + } + + // Check for gamepad input + var gamepad = Gamepad.current; + if (gamepad != null) + { + // Check sticks + if (gamepad.leftStick.ReadValue().sqrMagnitude > 0.01f || + gamepad.rightStick.ReadValue().sqrMagnitude > 0.01f) + { + usingController = true; + } + + // Check dpad + if (gamepad.dpad.ReadValue().sqrMagnitude > 0.01f) + { + usingController = true; + } + + // Check triggers + if (gamepad.leftTrigger.ReadValue() > 0.1f || + gamepad.rightTrigger.ReadValue() > 0.1f) + { + usingController = true; + } + + // Check buttons + foreach (var control in gamepad.allControls) + { + if (control is ButtonControl button && button.wasPressedThisFrame) + { + usingController = true; + break; + } + } + } + + bool changeToController = !_controller && usingController; + bool changeToKeyboardAndMouse = _controller && usingKeyboardOrMouse; + + if (changeToController || changeToKeyboardAndMouse) + { + _controller = changeToController; + OnInputDeviceChange?.Invoke(); + + if (OctoCore.Instance && OctoCore.Instance.Development.Log) + { + Debug.Log($"Platform: {Current}, Input: {(_controller ? "Controller" : "Keyboard/Mouse")}"); + } + } + } +#endif + + /// + /// Input detection using the old Input Manager. + /// This is the original implementation. + /// + private void DetectInputDeviceChange_OldSystem() + { +#if !ENABLE_INPUT_SYSTEM + bool usingController = Controller; + bool usingKeyboardOrMouse = !Controller; + + if (!usingController) + { + usingKeyboardOrMouse = Input.anyKeyDown || (Mathf.Abs(Input.GetAxis("Mouse X") + Input.GetAxis("Mouse Y")) > 0.1f); + } + else + { + usingController |= Mathf.Abs(Input.GetAxis("Joystick 1 X") + Input.GetAxis("Joystick 1 Y")) > 0.1f; + usingController |= Mathf.Abs(Input.GetAxis("Joystick 2 X") + Input.GetAxis("Joystick 2 Y")) > 0.1f; + usingController |= Input.GetAxis("Left Right Arrow") > 0.1f; + usingController |= Input.GetAxis("Left Right Arrow") < -0.1f; + usingController |= Input.GetAxis("Up Down Arrow") < -0.1f; + usingController |= Input.GetAxis("Up Down Arrow") > 0.1f; + usingController |= Input.GetAxis("Trigger L") > 0.2f; + usingController |= Input.GetAxis("Trigger R") > 0.2f; + + for (int i = 0; i <= 19; i++) + { + if (Input.GetKeyDown((KeyCode)((int)KeyCode.JoystickButton0 + i))) + { + usingController = true; + break; + } + } + } + + bool changeToController = !_controller && usingController; + bool changeToKeyboardAndMouse = _controller && usingKeyboardOrMouse; + + if (changeToController || changeToKeyboardAndMouse) + { + _controller = changeToController; + OnInputDeviceChange?.Invoke(); + + if (OctoCore.Instance && OctoCore.Instance.Development.Log) + { + Debug.Log($"Platform: {Current}"); + } + } +#endif + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatform.cs.meta b/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatform.cs.meta new file mode 100644 index 00000000..6eb7fe29 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatform.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5bdb4059a4feb6249b5fae7b226996bd \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatforms.cs b/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatforms.cs new file mode 100644 index 00000000..01519ebe --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatforms.cs @@ -0,0 +1,17 @@ +namespace OctoCore.Platform +{ + /// + /// Supported platforms for the OctoCore framework. + /// + public enum OctoPlatforms + { + Standalone, + XboxOne, + XboxSeries, + PS4, + PS5, + Switch, + Android, + iOS + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatforms.cs.meta b/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatforms.cs.meta new file mode 100644 index 00000000..12844c72 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Platform/OctoPlatforms.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5ed0a37e089e9564283e401f5d46c4b4 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Save.meta b/Packages/OctoCore/Runtime/Scripts/Save.meta new file mode 100644 index 00000000..09846f2f --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 06e91c49b48a3934b9d908fc7fe4aef4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data.meta b/Packages/OctoCore/Runtime/Scripts/Save/Data.meta new file mode 100644 index 00000000..4f0f4c3a --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e21560fb4a055504984fda6f526e45e8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoData.cs b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoData.cs new file mode 100644 index 00000000..9659b35e --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoData.cs @@ -0,0 +1,17 @@ +using UnityEngine; + +namespace OctoCore.Save.Data +{ + /// + /// Base class for all save data ScriptableObjects. + /// Provides a unique identifier for each data instance. + /// + public class OctoData : ScriptableObject + { + /// + /// Unique identifier for this data instance. + /// Automatically set to the asset name. + /// + [OctoReadOnly] public string Id; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoData.cs.meta b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoData.cs.meta new file mode 100644 index 00000000..d2c48ce2 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 496833ce6e1ccd3458cf6d9185f9d510 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataBool.cs b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataBool.cs new file mode 100644 index 00000000..e13247b5 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataBool.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace OctoCore.Save.Data +{ + /// + /// Boolean save data ScriptableObject. + /// + [CreateAssetMenu(fileName = "bool_", menuName = "Octo/Data/Bool", order = 0)] + public class OctoDataBool : OctoData + { + /// + /// Default value for this boolean data. + /// + public bool Value; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataBool.cs.meta b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataBool.cs.meta new file mode 100644 index 00000000..848bea4b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataBool.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 198561ebd23de0e4d878efdf99aa6cfc \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataFloat.cs b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataFloat.cs new file mode 100644 index 00000000..ef14ca0e --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataFloat.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace OctoCore.Save.Data +{ + /// + /// Float save data ScriptableObject. + /// + [CreateAssetMenu(fileName = "float_", menuName = "Octo/Data/Float", order = 2)] + public class OctoDataFloat : OctoData + { + /// + /// Default value for this float data. + /// + public float Value; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataFloat.cs.meta b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataFloat.cs.meta new file mode 100644 index 00000000..8a8c6933 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataFloat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a8b5df00abd22564e9e50406e8d5644b \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataInt.cs b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataInt.cs new file mode 100644 index 00000000..25b6c07f --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataInt.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace OctoCore.Save.Data +{ + /// + /// Integer save data ScriptableObject. + /// + [CreateAssetMenu(fileName = "int_", menuName = "Octo/Data/Int", order = 1)] + public class OctoDataInt : OctoData + { + /// + /// Default value for this integer data. + /// + public int Value; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataInt.cs.meta b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataInt.cs.meta new file mode 100644 index 00000000..02479237 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataInt.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9503febef22124742b1dc154f549b4fe \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataString.cs b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataString.cs new file mode 100644 index 00000000..59bb1d57 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataString.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace OctoCore.Save.Data +{ + /// + /// String save data ScriptableObject. + /// + [CreateAssetMenu(fileName = "string_", menuName = "Octo/Data/String", order = 3)] + public class OctoDataString : OctoData + { + /// + /// Default value for this string data. + /// + public string Value; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataString.cs.meta b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataString.cs.meta new file mode 100644 index 00000000..d6ad8a69 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataString.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d98ebfcec71f3a247b658908e9fee900 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataVector.cs b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataVector.cs new file mode 100644 index 00000000..9d8d2445 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataVector.cs @@ -0,0 +1,17 @@ +using UnityEngine; + +namespace OctoCore.Save.Data +{ + /// + /// Vector4 save data ScriptableObject. + /// Can store Vector2, Vector3, or Vector4 values. + /// + [CreateAssetMenu(fileName = "vector_", menuName = "Octo/Data/Vector", order = 4)] + public class OctoDataVector : OctoData + { + /// + /// Default value for this vector data. + /// + public Vector4 Value; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataVector.cs.meta b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataVector.cs.meta new file mode 100644 index 00000000..b365235c --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/Data/OctoDataVector.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5c87b0a5d0cf3cc4cb19b57e3694102d \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Save/OctoSave.cs b/Packages/OctoCore/Runtime/Scripts/Save/OctoSave.cs new file mode 100644 index 00000000..4e934a4b --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/OctoSave.cs @@ -0,0 +1,882 @@ + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Xml; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace OctoCore.Save +{ + /// + /// Save system module for managing persistent game data. + /// Handles saving and loading of boolean, integer, float, string, and vector data to XML files. + /// + [System.Serializable] + public class OctoSave : IOctoModule + { + public class Data + { + [HideInInspector] public string Id; + } + + [System.Serializable] + public class DataBool : Data + { + [OctoReadOnly] public global::OctoCore.Save.Data.OctoDataBool Data; + public bool Value; + public Action OnValueChanged; + + public void Set(bool value) + { + bool valueChanged = Value != value; + Value = value; + + if (valueChanged) + OnValueChanged?.Invoke(Value); + } + + public void Set(OctoVirtual.OctoVirtualBool virtualBool) + { + if (virtualBool != null) + Set(virtualBool.Value); + else if (OctoCore.Instance.Development.Log) + Debug.Log($"OctoVirtualBool is null"); + } + } + + [System.Serializable] + public class DataInt : Data + { + [OctoReadOnly] public global::OctoCore.Save.Data.OctoDataInt Data; + public int Value; + public Action OnValueChanged; + + public void Set(int value) + { + bool valueChanged = Value != value; + Value = value; + + if (valueChanged) + OnValueChanged?.Invoke(Value); + } + + public void Set(OctoVirtual.OctoVirtualInt virtualInt) + { + if (virtualInt != null) + Set(virtualInt.Value); + else if (OctoCore.Instance.Development.Log) + Debug.Log($"OctoVirtualInt is null"); + } + } + + [System.Serializable] + public class DataFloat : Data + { + [OctoReadOnly] public global::OctoCore.Save.Data.OctoDataFloat Data; + public float Value; + public Action OnValueChanged; + + public void Set(float value) + { + bool valueChanged = Value != value; + Value = value; + + if (valueChanged) + OnValueChanged?.Invoke(Value); + } + + public void Set(OctoVirtual.OctoVirtualFloat virtualFloat) + { + if (virtualFloat != null) + Set(virtualFloat.Value); + else if (OctoCore.Instance.Development.Log) + Debug.Log($"OctoVirtualFloat is null"); + } + } + + [System.Serializable] + public class DataString : Data + { + [OctoReadOnly] public global::OctoCore.Save.Data.OctoDataString Data; + public string Value; + public Action OnValueChanged; + + public void Set(string value) + { + bool valueChanged = Value != value; + Value = value; + + if (valueChanged) + OnValueChanged?.Invoke(Value); + } + + public void Set(OctoVirtual.OctoVirtualString virtualString) + { + if (virtualString != null) + Set(virtualString.Value); + else if (OctoCore.Instance.Development.Log) + Debug.Log($"OctoVirtualString is null"); + } + } + + [System.Serializable] + public class DataVector : Data + { + [OctoReadOnly] public global::OctoCore.Save.Data.OctoDataVector Data; + public Vector4 Value; + public Action OnValueChanged; + + public void Set(Vector4 value) + { + bool valueChanged = Value != value; + Value = value; + + if (valueChanged) + OnValueChanged?.Invoke(Value); + } + + public void Set(OctoVirtual.OctoVirtualVector virtualVector) + { + if (virtualVector != null) + Set(virtualVector.Value); + else if (OctoCore.Instance.Development.Log) + Debug.Log($"OctoVirtualVector is null"); + } + } + + public DataBool[] Booleans; + public DataInt[] Integers; + public DataFloat[] Floats; + public DataString[] Strings; + public DataVector[] Vectors; + + private Dictionary _booleansId; + private Dictionary _integersId; + private Dictionary _floatsId; + private Dictionary _stringsId; + private Dictionary _vectorsId; + + public void Init(OctoSettings settings) + { + if (!settings) + { + Debug.Log("No Settings Registered."); + return; + } + + #if UNITY_EDITOR + // Get all data + settings.GetAllDatas(); + #endif + + // Init values + + List tmpBooleans = new List(); + List tmpIntegers = new List(); + List tmpFloats = new List(); + List tmpStrings = new List(); + List tmpVectors = new List(); + + foreach (global::OctoCore.Save.Data.OctoDataBool dataBool in settings.Save.Booleans) + tmpBooleans.Add(new DataBool() { Id = dataBool.Id, Data = dataBool, Value = dataBool.Value }); + + foreach (global::OctoCore.Save.Data.OctoDataInt dataInt in settings.Save.Integers) + tmpIntegers.Add(new DataInt() { Id = dataInt.Id, Data = dataInt, Value = dataInt.Value }); + + foreach (global::OctoCore.Save.Data.OctoDataFloat dataFloat in settings.Save.Floats) + tmpFloats.Add(new DataFloat() { Id = dataFloat.Id, Data = dataFloat, Value = dataFloat.Value }); + + foreach (global::OctoCore.Save.Data.OctoDataString dataString in settings.Save.Strings) + tmpStrings.Add(new DataString() { Id = dataString.Id, Data = dataString, Value = dataString.Value }); + + foreach (global::OctoCore.Save.Data.OctoDataVector dataVector in settings.Save.Vectors) + tmpVectors.Add(new DataVector() { Id = dataVector.Id, Data = dataVector, Value = dataVector.Value }); + + Booleans = tmpBooleans.ToArray(); + Integers = tmpIntegers.ToArray(); + Floats = tmpFloats.ToArray(); + Strings = tmpStrings.ToArray(); + Vectors = tmpVectors.ToArray(); + + tmpBooleans.Clear(); + tmpIntegers.Clear(); + tmpFloats.Clear(); + tmpStrings.Clear(); + tmpVectors.Clear(); + + // Load values + + Load(); + + // Adress datas + + _booleansId = new Dictionary(); + _integersId = new Dictionary(); + _floatsId = new Dictionary(); + _stringsId = new Dictionary(); + _vectorsId = new Dictionary(); + + for (int i = 0; i < Booleans.Length; i++) + _booleansId.Add(Booleans[i].Id, i); + + for (int i = 0; i < Integers.Length; i++) + _integersId.Add(Integers[i].Id, i); + + for (int i = 0; i < Floats.Length; i++) + _floatsId.Add(Floats[i].Id, i); + + for (int i = 0; i < Strings.Length; i++) + _stringsId.Add(Strings[i].Id, i); + + for (int i = 0; i < Vectors.Length; i++) + _vectorsId.Add(Vectors[i].Id, i); + + // Callback OctoEvents + + if (OctoEvents.Instance) + OctoEvents.Instance.SetSaveInitialized(); + } + + public void Tick() + { + + } + + public void OnSceneChanged(Scene current, Scene next) + { + + } + + public void OnQuit() + { + Upgrade(); + } + + public void Load() + { + string path = GetPath(); + + bool saveLoaded = false; + + if (File.Exists(path)) + { + OctoVirtual virtualSave = new OctoVirtual + { + Booleans = ReadGroup(path, "Booleans"), + Integers = ReadGroup(path, "Integers"), + Floats = ReadGroup(path, "Floats"), + Strings = ReadGroup(path, "Strings"), + Vectors = ReadGroup(path, "Vectors") + }; + + foreach (DataBool dataBool in Booleans) + dataBool.Set(virtualSave.Booleans.Where(v => v.Id == dataBool.Id).FirstOrDefault()); + + foreach (DataInt dataInt in Integers) + dataInt.Set(virtualSave.Integers.Where(v => v.Id == dataInt.Id).FirstOrDefault()); + + foreach (DataFloat dataFloat in Floats) + dataFloat.Set(virtualSave.Floats.Where(v => v.Id == dataFloat.Id).FirstOrDefault()); + + foreach (DataString dataString in Strings) + dataString.Set(virtualSave.Strings.Where(v => v.Id == dataString.Id).FirstOrDefault()); + + foreach (DataVector dataVector in Vectors) + dataVector.Set(virtualSave.Vectors.Where(v => v.Id == dataVector.Id).FirstOrDefault()); + + saveLoaded = true; + + if (OctoCore.Instance.Development.Log) + { + if (saveLoaded) Debug.Log($"Save read from: {path}"); + else Debug.Log($"Save corrupted: {path}"); + } + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"No save found at: {path}"); + } + + T[] ReadGroup(string xmlPath, string groupName) where T : OctoVirtual, new() + { + List list = new List(); + + using (XmlReader reader = XmlReader.Create(xmlPath)) + { + // Jump to node + + while (reader.Read()) + { + if (reader.NodeType == XmlNodeType.Element && reader.Name == groupName) + { + string id = null; + string value = null; + + while (reader.Read()) + { + // Stop if end of group reached + + if (reader.NodeType == XmlNodeType.EndElement && reader.Name == groupName) + break; + + if (reader.NodeType == XmlNodeType.Element) + { + if (reader.Name == "ID") + id = reader.ReadElementContentAsString(); + else if (reader.Name == "Value") + value = reader.ReadElementContentAsString(); + + // Create entry + + if (id != null && value != null) + { + T entry = new T { Id = id }; + + switch (entry) + { + case OctoVirtual.OctoVirtualBool virtualBool: + virtualBool.Value = bool.Parse(value); + break; + + case OctoVirtual.OctoVirtualInt virtualInt: + virtualInt.Value = int.Parse(value); + break; + + case OctoVirtual.OctoVirtualFloat virtualFloat: + virtualFloat.Value = float.Parse(value); + break; + + case OctoVirtual.OctoVirtualString virtualString: + virtualString.Value = value; + break; + + case OctoVirtual.OctoVirtualVector virtualVector: + virtualVector.Value = StringToVector4(value); + break; + } + + list.Add(entry); + id = null; + value = null; + } + } + } + + break; + } + } + } + + return list.ToArray(); + } + + Vector4 StringToVector4(string s) + { + s = s.Trim('(', ')').Replace(" ", ""); + + string[] parts = s.Split(','); + + if (parts.Length != 4) + { + return Vector4.zero; + } + else + { + return new Vector4( + float.Parse(parts[0], CultureInfo.InvariantCulture), + float.Parse(parts[1], CultureInfo.InvariantCulture), + float.Parse(parts[2], CultureInfo.InvariantCulture), + float.Parse(parts[3], CultureInfo.InvariantCulture) + ); + } + } + } + + public void Upgrade() + { + // Set virtual save + + OctoVirtual virtualSave = new OctoVirtual() + { + Booleans = new OctoVirtual.OctoVirtualBool[Booleans.Length], + Integers = new OctoVirtual.OctoVirtualInt[Integers.Length], + Floats = new OctoVirtual.OctoVirtualFloat[Floats.Length], + Strings = new OctoVirtual.OctoVirtualString[Strings.Length], + Vectors = new OctoVirtual.OctoVirtualVector[Vectors.Length] + }; + + for (int i = 0; i < virtualSave.Booleans.Length; i++) + { + virtualSave.Booleans[i] = new OctoVirtual.OctoVirtualBool(); + virtualSave.Booleans[i].Id = Booleans[i].Id; + virtualSave.Booleans[i].Value = Booleans[i].Value; + } + + for (int i = 0; i < virtualSave.Integers.Length; i++) + { + virtualSave.Integers[i] = new OctoVirtual.OctoVirtualInt(); + virtualSave.Integers[i].Id = Integers[i].Id; + virtualSave.Integers[i].Value = Integers[i].Value; + } + + for (int i = 0; i < virtualSave.Floats.Length; i++) + { + virtualSave.Floats[i] = new OctoVirtual.OctoVirtualFloat(); + virtualSave.Floats[i].Id = Floats[i].Id; + virtualSave.Floats[i].Value = Floats[i].Value; + } + + for (int i = 0; i < virtualSave.Strings.Length; i++) + { + virtualSave.Strings[i] = new OctoVirtual.OctoVirtualString(); + virtualSave.Strings[i].Id = Strings[i].Id; + virtualSave.Strings[i].Value = Strings[i].Value; + } + + for (int i = 0; i < virtualSave.Vectors.Length; i++) + { + virtualSave.Vectors[i] = new OctoVirtual.OctoVirtualVector(); + virtualSave.Vectors[i].Id = Vectors[i].Id; + virtualSave.Vectors[i].Value = Vectors[i].Value; + } + + // Save file + + string path = GetPath(); + + using (XmlWriter writer = XmlWriter.Create(path, new XmlWriterSettings { Indent = true })) + { + writer.WriteStartDocument(); + writer.WriteStartElement("OctoSave"); + + void WriteGroup(string groupName, T[] array) where T : OctoVirtual + { + if (array == null || array.Length == 0) return; + + writer.WriteStartElement(groupName); + + foreach (var item in array) + { + writer.WriteElementString("ID", item.Id); + + switch (item) + { + case OctoVirtual.OctoVirtualBool virtualBool: + writer.WriteElementString("Value", virtualBool.Value.ToString().ToLower()); + break; + + case OctoVirtual.OctoVirtualInt virtualInt: + writer.WriteElementString("Value", virtualInt.Value.ToString()); + break; + + case OctoVirtual.OctoVirtualFloat virtualFloat: + writer.WriteElementString("Value", virtualFloat.Value.ToString()); + break; + + case OctoVirtual.OctoVirtualString virtualString: + writer.WriteElementString("Value", virtualString.Value); + break; + + case OctoVirtual.OctoVirtualVector virtualVector: + writer.WriteElementString("Value", virtualVector.Value.ToString()); + break; + } + } + + writer.WriteEndElement(); + } + + WriteGroup("Booleans", virtualSave.Booleans); + WriteGroup("Integers", virtualSave.Integers); + WriteGroup("Floats", virtualSave.Floats); + WriteGroup("Strings", virtualSave.Strings); + WriteGroup("Vectors", virtualSave.Vectors); + + writer.WriteEndElement(); + writer.WriteEndDocument(); + } + + if (OctoCore.Instance.Development.Log) Debug.Log($"Saved to: {path}"); + } + + public void Unsubscribe(global::OctoCore.Save.Data.OctoData data, Action action) + { + Subscribe(data, action, false); + } + + public void Subscribe(global::OctoCore.Save.Data.OctoData data, Action handler, bool subscribe = true) + { + if (data == null || string.IsNullOrEmpty(data.Id)) + { + if (OctoCore.Instance.Development.Log) + Debug.Log("Data is null or has no ID"); + return; + } + + switch (data) + { + case global::OctoCore.Save.Data.OctoDataBool _ when _booleansId.TryGetValue(data.Id, out int iBool): + if (subscribe) Booleans[iBool].OnValueChanged += handler as Action; + else Booleans[iBool].OnValueChanged -= handler as Action; + break; + + case global::OctoCore.Save.Data.OctoDataInt _ when _integersId.TryGetValue(data.Id, out int iInt): + if (subscribe) Integers[iInt].OnValueChanged += handler as Action; + else Integers[iInt].OnValueChanged -= handler as Action; + break; + + case global::OctoCore.Save.Data.OctoDataFloat _ when _floatsId.TryGetValue(data.Id, out int iFloat): + if (subscribe) Floats[iFloat].OnValueChanged += handler as Action; + else Floats[iFloat].OnValueChanged -= handler as Action; + break; + + case global::OctoCore.Save.Data.OctoDataString _ when _stringsId.TryGetValue(data.Id, out int iString): + if (subscribe) Strings[iString].OnValueChanged += handler as Action; + else Strings[iString].OnValueChanged -= handler as Action; + break; + + case global::OctoCore.Save.Data.OctoDataVector _ when _vectorsId.TryGetValue(data.Id, out int iVector): + if (subscribe) Vectors[iVector].OnValueChanged += handler as Action; + else Vectors[iVector].OnValueChanged -= handler as Action; + break; + + default: + if (OctoCore.Instance.Development.Log) + Debug.Log($"Unsupported or missing data: {data.Id}"); + break; + } + } + + #region GET + + public bool Get(global::OctoCore.Save.Data.OctoDataBool dataBool) + { + if (dataBool) + { + if (_booleansId.ContainsKey(dataBool.Id)) + { + return Booleans[_booleansId[dataBool.Id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Bool data not found: {dataBool.Id}"); + } + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Bool data is null"); + } + + return false; + } + + public int Get(global::OctoCore.Save.Data.OctoDataInt dataInt) + { + if (dataInt) + { + if (_integersId.ContainsKey(dataInt.Id)) + { + return Integers[_integersId[dataInt.Id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Int data not found: {dataInt.Id}"); + } + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Int data is null"); + } + + return 0; + } + + public float Get(global::OctoCore.Save.Data.OctoDataFloat dataFloat) + { + if (dataFloat) + { + if (_floatsId.ContainsKey(dataFloat.Id)) + { + return Floats[_floatsId[dataFloat.Id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Int data not found: {dataFloat.Id}"); + } + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Int data is null"); + } + + return 0; + } + + public string Get(global::OctoCore.Save.Data.OctoDataString dataString) + { + if (dataString) + { + if (_stringsId.ContainsKey(dataString.Id)) + { + return Strings[_stringsId[dataString.Id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Int data not found: {dataString.Id}"); + } + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Int data is null"); + } + + return string.Empty; + } + + public Vector4 Get(global::OctoCore.Save.Data.OctoDataVector dataVector) + { + if (dataVector) + { + if (_vectorsId.ContainsKey(dataVector.Id)) + { + return Vectors[_vectorsId[dataVector.Id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Vector data not found: {dataVector.Id}"); + } + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Vector data is null"); + } + + return Vector4.zero; + } + + public bool GetBool(string id) + { + if (_booleansId.ContainsKey(id)) + { + return Booleans[_booleansId[id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Bool data not found: {id}"); + } + + return false; + } + + public int GetInt(string id) + { + if (_integersId.ContainsKey(id)) + { + return Integers[_integersId[id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Int data not found: {id}"); + } + + return 0; + } + + public float GetFloat(string id) + { + if (_floatsId.ContainsKey(id)) + { + return Floats[_floatsId[id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Float data not found: {id}"); + } + + return 0; + } + + public string GetString(string id) + { + if (_stringsId.ContainsKey(id)) + { + return Strings[_stringsId[id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"String data not found: {id}"); + } + + return string.Empty; + } + + public Vector4 GetVector(string id) + { + if (_vectorsId.ContainsKey(id)) + { + return Vectors[_vectorsId[id]].Value; + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"String data not found: {id}"); + } + + return Vector4.zero; + } + + #endregion + + #region SET + + public void Set(global::OctoCore.Save.Data.OctoDataBool dataBool, bool value) + { + if (dataBool != null && _booleansId.ContainsKey(dataBool.Id)) + { + Booleans[_booleansId[dataBool.Id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Bool data is null or not found"); + } + } + + public void Set(global::OctoCore.Save.Data.OctoDataInt dataInt, int value) + { + if (dataInt != null && _integersId.ContainsKey(dataInt.Id)) + { + Integers[_integersId[dataInt.Id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Int data is null or not found"); + } + } + + public void Set(global::OctoCore.Save.Data.OctoDataFloat dataFloat, float value) + { + if (dataFloat != null && _floatsId.ContainsKey(dataFloat.Id)) + { + Floats[_floatsId[dataFloat.Id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Float data is null or not found"); + } + } + + public void Set(global::OctoCore.Save.Data.OctoDataString dataString, string value) + { + if (dataString != null && _stringsId.ContainsKey(dataString.Id)) + { + Strings[_stringsId[dataString.Id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"String data is null or not found"); + } + } + + public void Set(global::OctoCore.Save.Data.OctoDataVector dataVector, Vector4 value) + { + if (dataVector != null && _vectorsId.ContainsKey(dataVector.Id)) + { + Vectors[_vectorsId[dataVector.Id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Vector data is null or not found"); + } + } + + public void SetBool(string id, bool value) + { + if (_booleansId.ContainsKey(id)) + { + Booleans[_booleansId[id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Bool data not found: {id}"); + } + } + + public void SetInt(string id, int value) + { + if (_booleansId.ContainsKey(id)) + { + Integers[_integersId[id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Int data not found: {id}"); + } + } + + public void SetFloat(string id, float value) + { + if (_floatsId.ContainsKey(id)) + { + Floats[_floatsId[id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"Float data not found: {id}"); + } + } + + public void SetString(string id, string value) + { + if (_stringsId.ContainsKey(id)) + { + Strings[_stringsId[id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"String data not found: {id}"); + } + } + + public void SetVector(string id, Vector4 value) + { + if (_vectorsId.ContainsKey(id)) + { + Vectors[_vectorsId[id]].Set(value); + } + else if (OctoCore.Instance.Development.Log) + { + Debug.Log($"String data not found: {id}"); + } + } + + #endregion + + private string GetPath() + { + Platform.OctoPlatforms platform = OctoCore.Instance ? OctoCore.Instance.Platform.Current : Platform.OctoPlatforms.Standalone; + + switch (platform) + { + default: + return Path.Combine(Application.persistentDataPath, "Save.xml"); + + case Platform.OctoPlatforms.XboxOne: + return Path.Combine(Application.persistentDataPath, "Save.xml"); + + case Platform.OctoPlatforms.XboxSeries: + return Path.Combine(Application.persistentDataPath, "Save.xml"); + + case Platform.OctoPlatforms.PS4: + return Path.Combine(Application.persistentDataPath, "Save.xml"); + + case Platform.OctoPlatforms.PS5: + return Path.Combine(Application.persistentDataPath, "Save.xml"); + + case Platform.OctoPlatforms.Switch: + return Path.Combine(Application.persistentDataPath, "Save.xml"); + } + } + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Save/OctoSave.cs.meta b/Packages/OctoCore/Runtime/Scripts/Save/OctoSave.cs.meta new file mode 100644 index 00000000..07a5f95e --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/OctoSave.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a2494453b88d39d44808f2ee3d8d72cb \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Save/OctoSerializableDictionary.cs b/Packages/OctoCore/Runtime/Scripts/Save/OctoSerializableDictionary.cs new file mode 100644 index 00000000..67784535 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/OctoSerializableDictionary.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace OctoCore.Save +{ + /// + /// A dictionary that can be serialized by Unity. + /// Converts between Dictionary and List representations for Unity serialization. + /// + /// The type of keys in the dictionary. + /// The type of values in the dictionary. + [Serializable] + public class OctoSerializableDictionary : ISerializationCallbackReceiver + { + [SerializeField] private List _keys = new(); + [SerializeField] private List _values = new(); + + private Dictionary _dictionary = new(); + + /// + /// Gets the underlying dictionary. + /// + public Dictionary Dictionary => _dictionary; + + /// + /// Called before Unity serializes the object. + /// Converts the dictionary to lists for serialization. + /// + public void OnBeforeSerialize() + { + _keys.Clear(); + _values.Clear(); + + foreach (var kvp in _dictionary) + { + _keys.Add(kvp.Key); + _values.Add(kvp.Value); + } + } + + /// + /// Called after Unity deserializes the object. + /// Reconstructs the dictionary from serialized lists. + /// + public void OnAfterDeserialize() + { + _dictionary = new Dictionary(); + + for (int i = 0; i < Math.Min(_keys.Count, _values.Count); i++) + { + _dictionary[_keys[i]] = _values[i]; + } + } + + /// + /// Gets or sets the value associated with the specified key. + /// + /// The key to access. + /// The value associated with the key, or default if not found. + public TValue this[TKey key] + { + get => _dictionary.ContainsKey(key) ? _dictionary[key] : default; + set => _dictionary[key] = value; + } + + /// + /// Determines whether the dictionary contains the specified key. + /// + /// The key to locate. + /// True if the dictionary contains the key; otherwise, false. + public bool ContainsKey(TKey key) => _dictionary.ContainsKey(key); + + /// + /// Removes the value with the specified key from the dictionary. + /// + /// The key of the element to remove. + public void Remove(TKey key) => _dictionary.Remove(key); + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Save/OctoSerializableDictionary.cs.meta b/Packages/OctoCore/Runtime/Scripts/Save/OctoSerializableDictionary.cs.meta new file mode 100644 index 00000000..7ec253ac --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/OctoSerializableDictionary.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b10efb0f335abac4195d702b9dc836d6 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Save/OctoVirtual.cs b/Packages/OctoCore/Runtime/Scripts/Save/OctoVirtual.cs new file mode 100644 index 00000000..2693f25e --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/OctoVirtual.cs @@ -0,0 +1,96 @@ +using UnityEngine; + +namespace OctoCore.Save +{ + /// + /// Virtual representation of save data used for XML serialization/deserialization. + /// This class mirrors the runtime save data structure for loading from disk. + /// + public class OctoVirtual + { + /// + /// Unique identifier for this data entry. + /// + public string Id; + + /// + /// Virtual boolean data entry. + /// + public class OctoVirtualBool : OctoVirtual + { + /// + /// Boolean value loaded from save file. + /// + public bool Value; + } + + /// + /// Virtual integer data entry. + /// + public class OctoVirtualInt : OctoVirtual + { + /// + /// Integer value loaded from save file. + /// + public int Value; + } + + /// + /// Virtual float data entry. + /// + public class OctoVirtualFloat : OctoVirtual + { + /// + /// Float value loaded from save file. + /// + public float Value; + } + + /// + /// Virtual string data entry. + /// + public class OctoVirtualString : OctoVirtual + { + /// + /// String value loaded from save file. + /// + public string Value; + } + + /// + /// Virtual vector data entry. + /// + public class OctoVirtualVector : OctoVirtual + { + /// + /// Vector4 value loaded from save file. + /// + public Vector4 Value; + } + + /// + /// Array of boolean data entries. + /// + public OctoVirtualBool[] Booleans; + + /// + /// Array of integer data entries. + /// + public OctoVirtualInt[] Integers; + + /// + /// Array of float data entries. + /// + public OctoVirtualFloat[] Floats; + + /// + /// Array of string data entries. + /// + public OctoVirtualString[] Strings; + + /// + /// Array of vector data entries. + /// + public OctoVirtualVector[] Vectors; + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Save/OctoVirtual.cs.meta b/Packages/OctoCore/Runtime/Scripts/Save/OctoVirtual.cs.meta new file mode 100644 index 00000000..571808b2 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Save/OctoVirtual.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ecc8786bc13f70e49ae9b0ec830b0ec9 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/UI.meta b/Packages/OctoCore/Runtime/Scripts/UI.meta new file mode 100644 index 00000000..24eef413 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7f36a0005faa6a5479da01740d7d4472 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/UI/OctoUI.cs b/Packages/OctoCore/Runtime/Scripts/UI/OctoUI.cs new file mode 100644 index 00000000..a0b0d033 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/UI/OctoUI.cs @@ -0,0 +1,105 @@ +using OctoCore.Components; +using System; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace OctoCore.UI +{ + /// + /// UI management module. + /// Handles global UI scaling and screen size detection. + /// + [System.Serializable] + public class OctoUI : IOctoModule + { + /// + /// Global scale factor for all UI elements. + /// + public float GlobalScale = 1; + + /// + /// Current screen size in pixels. + /// + [OctoReadOnly] public Vector2Int ScreenSize; + + private Action OnGlobalScaleChange; + private Action OnScreenResize; + + public void Init(OctoSettings settings) + { + // Callback OctoEvents + + if (OctoEvents.Instance) + OctoEvents.Instance.SetUiInitialized(); + } + + public void Tick() + { + CheckSize(); + } + + public void OnSceneChanged(Scene current, Scene next) + { + + } + + public void OnQuit() + { + + } + + public void UnsubscribeOnGlobalScaleChange(Action handler) + { + SubscribeOnGlobalScaleChange(handler, false); + } + + public void SubscribeOnGlobalScaleChange(Action handler, bool subscribe = true) + { + if (subscribe) OnGlobalScaleChange += handler; + else OnGlobalScaleChange -= handler; + } + + public void UnsubscribeOnScreenResize(Action handler) + { + SubscribeOnScreenResize(handler, false); + } + + public void SubscribeOnScreenResize(Action handler, bool subscribe = true) + { + if (subscribe) OnScreenResize += handler; + else OnScreenResize -= handler; + } + + public void SetGlobalScale(float scale) + { + GlobalScale = scale; + OnGlobalScaleChange?.Invoke(scale); + } + + public void CheckSize() + { + if (ScreenSize.x != Screen.width || ScreenSize.y != Screen.height) + { + ScreenSize.x = Screen.width; + ScreenSize.y = Screen.height; + + OnScreenResize?.Invoke(ScreenSize); + } + } + + public void SetCursor() + { + bool visible = true; + CursorLockMode lockMode = CursorLockMode.None; + + if (OctoPlayer.Instance && !OctoPlayer.Instance.IsPaused) + { + visible = true; + lockMode = CursorLockMode.Locked; + } + + Cursor.visible = visible; + Cursor.lockState = lockMode; + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/UI/OctoUI.cs.meta b/Packages/OctoCore/Runtime/Scripts/UI/OctoUI.cs.meta new file mode 100644 index 00000000..3b35cf33 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/UI/OctoUI.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 810bd977c701b444698d99ea57294f02 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/UI/OctoUIAnchor.cs b/Packages/OctoCore/Runtime/Scripts/UI/OctoUIAnchor.cs new file mode 100644 index 00000000..aa404cc2 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/UI/OctoUIAnchor.cs @@ -0,0 +1,86 @@ +using Unity.VisualScripting; +using UnityEngine; +using UnityEngine.UIElements; + +namespace OctoCore.UI +{ + [RequireComponent(typeof(RectTransform))] + public class OctoUIAnchor : MonoBehaviour + { + [SerializeField, OctoReadOnly] RectTransform _rectTransform; + [SerializeField] TextAnchor _anchor; + + void OnValidate() + { + name = "Anchor_" + _anchor.ToString(); + + if (!_rectTransform) + _rectTransform = GetComponent(); + + if (_rectTransform) + { + switch (_anchor) + { + case TextAnchor.UpperLeft: + _rectTransform.pivot = new Vector2(0, 1); + break; + + case TextAnchor.UpperCenter: + _rectTransform.pivot = new Vector2(.5f, 1); + break; + + case TextAnchor.UpperRight: + _rectTransform.pivot = new Vector2(1, 1); + break; + + case TextAnchor.MiddleLeft: + _rectTransform.pivot = new Vector2(0, .5f); + break; + + case TextAnchor.MiddleCenter: + _rectTransform.pivot = new Vector2(.5f, .5f); + break; + + case TextAnchor.MiddleRight: + _rectTransform.pivot = new Vector2(1, .5f); + break; + + case TextAnchor.LowerLeft: + _rectTransform.pivot = new Vector2(0, 0); + break; + + case TextAnchor.LowerCenter: + _rectTransform.pivot = new Vector2(.5f, 0); + break; + + case TextAnchor.LowerRight: + _rectTransform.pivot = new Vector2(1, 0); + break; + } + } + } + + void Awake() + { + if (OctoCore.Instance) + { + OctoCore.Instance.UI.SubscribeOnGlobalScaleChange(SetScale); + SetScale(OctoCore.Instance.UI.GlobalScale); + } + } + + void OnDestroy() + { + if (OctoCore.Instance) + OctoCore.Instance.UI.UnsubscribeOnGlobalScaleChange(SetScale); + } + + public void SetScale(float scale) + { + if (!_rectTransform) + return; + + _rectTransform.localScale = Vector3.one * scale; + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/UI/OctoUIAnchor.cs.meta b/Packages/OctoCore/Runtime/Scripts/UI/OctoUIAnchor.cs.meta new file mode 100644 index 00000000..c9a0a8b2 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/UI/OctoUIAnchor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9e3f3e4f661e9d24395c654b7a77169b \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/UI/OctoUIManager.cs b/Packages/OctoCore/Runtime/Scripts/UI/OctoUIManager.cs new file mode 100644 index 00000000..eaf1eeab --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/UI/OctoUIManager.cs @@ -0,0 +1,116 @@ +using System; +using UnityEngine; +using UnityEngine.UI; + +namespace OctoCore.UI +{ + /// + /// UI Manager component for managing canvas scaling. + /// Automatically adjusts canvas scale factor based on screen size. + /// + [ExecuteAlways] + public class OctoUIManager : MonoBehaviour + { + /// + /// References to UI settings and canvas scaler. + /// + [System.Serializable] + public class References + { + public CanvasScaler CanvasScaler; + } + + [SerializeField] private bool dontDestroy = true; + [SerializeField] private bool updateInEditor; + [SerializeField] private References references; + + private Action onScreenResize; + + #if UNITY_EDITOR + private Vector2Int currentScreenSize; + #endif + + void Awake() + { + #if UNITY_EDITOR + if (!Application.isPlaying && !updateInEditor) return; + #endif + + if (dontDestroy) + DontDestroyOnLoad(this); + + if (OctoCore.Instance) + OctoCore.Instance.UI.SubscribeOnScreenResize(onScreenResize = OnScreenResize); + } + + void OnEnable() + { + #if UNITY_EDITOR + if (!Application.isPlaying && !updateInEditor) return; + #endif + + RescaleCanvas(); + } + + void Update() + { + #if UNITY_EDITOR + if (!Application.isPlaying && updateInEditor) + RescaleCanvas(new Vector2Int(Screen.width, Screen.height)); + #endif + } + + void OnDestroy() + { + #if UNITY_EDITOR + if (!Application.isPlaying && !updateInEditor) return; + #endif + + if (onScreenResize != null && OctoCore.Instance) + { + OctoCore.Instance.UI.UnsubscribeOnScreenResize(onScreenResize); + onScreenResize = null; + } + } + + private void OnScreenResize(Vector2Int screenSize) + { + RescaleCanvas(screenSize); + } + + public void RescaleCanvas() + { + if (!OctoCore.Instance || !OctoCore.Instance.Settings) return; + + RescaleCanvas(OctoCore.Instance.UI.ScreenSize, OctoCore.Instance.Settings.Ui.ReferenceSize); + } + + public void RescaleCanvas(Vector2Int screenSize) + { + if (!OctoCore.Instance || !OctoCore.Instance.Settings) return; + + RescaleCanvas(screenSize, OctoCore.Instance.Settings.Ui.ReferenceSize); + } + + private void RescaleCanvas(Vector2Int screenSize, Vector2Int referenceSize) + { + if (!references.CanvasScaler) return; + + #if UNITY_EDITOR + if (!Application.isPlaying && updateInEditor) + { + if (currentScreenSize == screenSize) return; + currentScreenSize = screenSize; + } + #endif + + float scaleFactor = Mathf.Min((float)screenSize.x / referenceSize.x, (float)screenSize.y / referenceSize.y); + if (scaleFactor == 0) return; + + references.CanvasScaler.scaleFactor = scaleFactor; + + if (OctoCore.Instance && OctoCore.Instance.Development.Log) + Debug.Log($"Canvas scale factor updated: {scaleFactor}"); + } + } +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/UI/OctoUIManager.cs.meta b/Packages/OctoCore/Runtime/Scripts/UI/OctoUIManager.cs.meta new file mode 100644 index 00000000..60b757f0 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/UI/OctoUIManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 867a31b76989f4b439835acbf722b1d9 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Utilities.meta b/Packages/OctoCore/Runtime/Scripts/Utilities.meta new file mode 100644 index 00000000..8bf9cc60 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Utilities.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e945353bbcabb5c47a0d2aa9fd73faa1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Scripts/Utilities/OctoEvents.cs b/Packages/OctoCore/Runtime/Scripts/Utilities/OctoEvents.cs new file mode 100644 index 00000000..d76081be --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Utilities/OctoEvents.cs @@ -0,0 +1,8 @@ +namespace OctoCore.Utilities +{ +public enum OctoEvents +{ + None, Action, Awake, OnEnable, Start, Update, FixedUpdate, LateUpdate, OnDisable, OnDestroy, OnTriggerEnter, OnTriggerStay, OnTriggerExit +} + +} \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Utilities/OctoEvents.cs.meta b/Packages/OctoCore/Runtime/Scripts/Utilities/OctoEvents.cs.meta new file mode 100644 index 00000000..084b0de3 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Utilities/OctoEvents.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c32a73e226ce02b49852472e5517756c \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Scripts/Utilities/OctoReadOnlyAttribute.cs b/Packages/OctoCore/Runtime/Scripts/Utilities/OctoReadOnlyAttribute.cs new file mode 100644 index 00000000..cfb1203e --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Utilities/OctoReadOnlyAttribute.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace OctoCore +{ + /// + /// PropertyAttribute that makes a field read-only in the Unity Inspector. + /// The field can still be modified through code. + /// + public class OctoReadOnlyAttribute : PropertyAttribute + { + } +} diff --git a/Packages/OctoCore/Runtime/Scripts/Utilities/OctoReadOnlyAttribute.cs.meta b/Packages/OctoCore/Runtime/Scripts/Utilities/OctoReadOnlyAttribute.cs.meta new file mode 100644 index 00000000..b9cf0f97 --- /dev/null +++ b/Packages/OctoCore/Runtime/Scripts/Utilities/OctoReadOnlyAttribute.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 456813b4a873a9d479a4b5e0f99010b4 \ No newline at end of file diff --git a/Packages/OctoCore/Runtime/Ui.meta b/Packages/OctoCore/Runtime/Ui.meta new file mode 100644 index 00000000..cc977962 --- /dev/null +++ b/Packages/OctoCore/Runtime/Ui.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8f677786805a4c249ad585c59b26dfef +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/Runtime/Ui/icon_OctoCore.png b/Packages/OctoCore/Runtime/Ui/icon_OctoCore.png new file mode 100644 index 00000000..0fb5951d Binary files /dev/null and b/Packages/OctoCore/Runtime/Ui/icon_OctoCore.png differ diff --git a/Packages/OctoCore/Runtime/Ui/icon_OctoCore.png.meta b/Packages/OctoCore/Runtime/Ui/icon_OctoCore.png.meta new file mode 100644 index 00000000..0e23e935 --- /dev/null +++ b/Packages/OctoCore/Runtime/Ui/icon_OctoCore.png.meta @@ -0,0 +1,156 @@ +fileFormatVersion: 2 +guid: 1f5193a693ca01c44a6f5d073aa7ad8f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: iOS + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/OctoCore/package.json b/Packages/OctoCore/package.json new file mode 100644 index 00000000..135fc451 --- /dev/null +++ b/Packages/OctoCore/package.json @@ -0,0 +1,10 @@ +{ + "name": "com.coiriergraphics.octocore", + "version": "0.0.1", + "displayName": "OctoCore", + "unity": "6000.0", + "description": "Core framework modules for Unity.", + "dependencies": { + "com.unity.inputsystem": "1.7.0" + } +} \ No newline at end of file diff --git a/Packages/OctoCore/package.json.meta b/Packages/OctoCore/package.json.meta new file mode 100644 index 00000000..ba17bcc8 --- /dev/null +++ b/Packages/OctoCore/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 92d386114b9e1f14aa198f7641035d3a +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index d4719eb3..e760e591 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,11 +1,11 @@ { "dependencies": { - "com.bezi.sidekick": { - "version": "file:com.bezi.sidekick", + "com.coiriergraphics.octocore": { + "version": "file:OctoCore", "depth": 0, "source": "embedded", "dependencies": { - "com.unity.nuget.newtonsoft-json": "3.2.1" + "com.unity.inputsystem": "1.7.0" } }, "com.unity.2d.sprite": { @@ -108,13 +108,6 @@ "dependencies": {}, "url": "https://packages.unity.com" }, - "com.unity.nuget.newtonsoft-json": { - "version": "3.2.2", - "depth": 1, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, "com.unity.probuilder": { "version": "6.0.8", "depth": 0, diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset index fc90ab95..c99cf2fc 100644 --- a/ProjectSettings/DynamicsManager.asset +++ b/ProjectSettings/DynamicsManager.asset @@ -3,10 +3,11 @@ --- !u!55 &1 PhysicsManager: m_ObjectHideFlags: 0 - serializedVersion: 13 + serializedVersion: 22 m_Gravity: {x: 0, y: -9.81, z: 0} m_DefaultMaterial: {fileID: 0} m_BounceThreshold: 2 + m_DefaultMaxDepenetrationVelocity: 10 m_SleepThreshold: 0.005 m_DefaultContactOffset: 0.01 m_DefaultSolverIterations: 6 @@ -16,11 +17,11 @@ PhysicsManager: m_EnableAdaptiveForce: 0 m_ClothInterCollisionDistance: 0.1 m_ClothInterCollisionStiffness: 0.2 - m_ContactsGeneration: 1 - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - m_AutoSimulation: 1 + m_LayerCollisionMatrix: ffffefffffffefffffffefffffffefffffffefffffffefffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_SimulationMode: 0 m_AutoSyncTransforms: 0 m_ReuseCollisionCallbacks: 1 + m_InvokeCollisionCallbacks: 1 m_ClothInterCollisionSettingsToggle: 0 m_ClothGravity: {x: 0, y: -9.81, z: 0} m_ContactPairsMode: 0 @@ -31,6 +32,13 @@ PhysicsManager: m_WorldSubdivisions: 8 m_FrictionType: 0 m_EnableEnhancedDeterminism: 0 - m_EnableUnifiedHeightmaps: 1 + m_ImprovedPatchFriction: 0 + m_GenerateOnTriggerStayEvents: 1 m_SolverType: 0 m_DefaultMaxAngularSpeed: 50 + m_ScratchBufferChunkCount: 4 + m_CurrentBackendId: 4072204805 + m_FastMotionThreshold: 3.4028235e+38 + m_SceneBuffersReleaseInterval: 0 + m_ReleaseSceneBuffers: 0 + m_LogVerbosity: 3 diff --git a/ProjectSettings/PackageManagerSettings.asset b/ProjectSettings/PackageManagerSettings.asset index be4a7974..b0ef9591 100644 --- a/ProjectSettings/PackageManagerSettings.asset +++ b/ProjectSettings/PackageManagerSettings.asset @@ -12,11 +12,13 @@ MonoBehaviour: m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} m_Name: m_EditorClassIdentifier: - m_EnablePreviewPackages: 0 - m_EnablePackageDependencies: 0 + m_EnablePreReleasePackages: 0 m_AdvancedSettingsExpanded: 1 m_ScopedRegistriesSettingsExpanded: 1 + m_SeeAllPackageVersions: 0 + m_DismissPreviewPackagesInUse: 0 oneTimeWarningShown: 0 + oneTimePackageErrorsPopUpShown: 1 m_Registries: - m_Id: main m_Name: @@ -24,20 +26,15 @@ MonoBehaviour: m_Scopes: [] m_IsDefault: 1 m_Capabilities: 7 + m_ConfigSource: 0 + m_Compliance: + m_Status: 0 + m_Violations: [] m_UserSelectedRegistryName: m_UserAddingNewScopedRegistry: 0 m_RegistryInfoDraft: - m_ErrorMessage: - m_Original: - m_Id: - m_Name: - m_Url: - m_Scopes: [] - m_IsDefault: 0 - m_Capabilities: 0 m_Modified: 0 - m_Name: - m_Url: - m_Scopes: - - - m_SelectedScopeIndex: 0 + m_ErrorMessage: + m_UserModificationsInstanceId: -918 + m_OriginalInstanceId: -920 + m_LoadAssets: 0 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 9ac48c1d..8c6f49a2 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -24,8 +24,8 @@ TagManager: - - - - - - - + - Door + - BehindPortal - - - diff --git a/Unheimlich_POC.slnx b/Unheimlich_POC.slnx new file mode 100644 index 00000000..cd349c85 --- /dev/null +++ b/Unheimlich_POC.slnx @@ -0,0 +1,6 @@ + + + + + +