Compare commits
5 Commits
fe06b1529b
...
fort_fight
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a463e099b4 | ||
|
|
9b71b00441 | ||
|
|
88049ac97c | ||
|
|
0b8d2a279f | ||
|
|
d5ab69d944 |
13
.idea/.idea.AppleHillsProduction/.idea/.gitignore
generated
vendored
13
.idea/.idea.AppleHillsProduction/.idea/.gitignore
generated
vendored
@@ -1,13 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/modules.xml
|
||||
/projectSettingsUpdater.xml
|
||||
/contentModel.xml
|
||||
/.idea.AppleHillsProduction.iml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.AppleHillsProduction/.idea/vcs.xml
generated
6
.idea/.idea.AppleHillsProduction/.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -15,7 +15,7 @@ MonoBehaviour:
|
||||
m_DefaultGroup: 6f3207429a65b3e4b83935ac19791077
|
||||
m_currentHash:
|
||||
serializedVersion: 2
|
||||
Hash: 94be6fe6efc6ce35e614dcae21e98818
|
||||
Hash: ab5e2545873f5b7934dc716832e70d83
|
||||
m_OptimizeCatalogSize: 0
|
||||
m_BuildRemoteCatalog: 0
|
||||
m_CatalogRequestsTimeout: 0
|
||||
|
||||
@@ -15,6 +15,11 @@ MonoBehaviour:
|
||||
m_GroupName: Settings
|
||||
m_GUID: c62e6f02418e19949bca4cccdd5fa02e
|
||||
m_SerializeEntries:
|
||||
- m_GUID: 1476365959c6ead48985cb10ae82696f
|
||||
m_Address: Settings/Developer/FortFightDeveloperSettings
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 328ce914b893df646be3ad3c62755453
|
||||
m_Address: Settings/Developer/DivingDeveloperSettings
|
||||
m_ReadOnly: 0
|
||||
@@ -45,6 +50,11 @@ MonoBehaviour:
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 60eb7d51afc72e845836d38e77462855
|
||||
m_Address: Settings/FortFightSettings
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 8f5195fb013895049a19488fd4d8f2a1
|
||||
m_Address: Settings/InteractionSettings
|
||||
m_ReadOnly: 0
|
||||
|
||||
8
Assets/Data/Minigames/FortFight.meta
Normal file
8
Assets/Data/Minigames/FortFight.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 119c34a520b135848916bca00d03b9eb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
19
Assets/Data/Minigames/FortFight/CeilingFan.asset
Normal file
19
Assets/Data/Minigames/FortFight/CeilingFan.asset
Normal file
@@ -0,0 +1,19 @@
|
||||
%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: 973f02063e5446598db4cbffdbf8f113, type: 3}
|
||||
m_Name: CeilingFan
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Data.ProjectileData
|
||||
prefab: {fileID: 4342087378442690536, guid: ff8b62fb437256043aa6bd0b5441316b, type: 3}
|
||||
cooldownTime: 4
|
||||
icon: {fileID: -765527507412255412, guid: f70246e6148769846aaea223ec0c2a55, type: 3}
|
||||
displayName:
|
||||
description:
|
||||
8
Assets/Data/Minigames/FortFight/CeilingFan.asset.meta
Normal file
8
Assets/Data/Minigames/FortFight/CeilingFan.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac7c85630db3d7246b832aea2e4c9191
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
19
Assets/Data/Minigames/FortFight/Toaster.asset
Normal file
19
Assets/Data/Minigames/FortFight/Toaster.asset
Normal file
@@ -0,0 +1,19 @@
|
||||
%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: 973f02063e5446598db4cbffdbf8f113, type: 3}
|
||||
m_Name: Toaster
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Data.ProjectileData
|
||||
prefab: {fileID: 4820392328973485589, guid: a4b194a56edefa541b7c3bd7d70c8ba5, type: 3}
|
||||
cooldownTime: 3
|
||||
icon: {fileID: 6674386295937086461, guid: 3bd1c178a78fcd144965cd1731dc309b, type: 3}
|
||||
displayName:
|
||||
description:
|
||||
8
Assets/Data/Minigames/FortFight/Toaster.asset.meta
Normal file
8
Assets/Data/Minigames/FortFight/Toaster.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d84011b72b4f68342be14648246bc31b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
20
Assets/Data/Minigames/FortFight/TrashBag.asset
Normal file
20
Assets/Data/Minigames/FortFight/TrashBag.asset
Normal file
@@ -0,0 +1,20 @@
|
||||
%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: 973f02063e5446598db4cbffdbf8f113, type: 3}
|
||||
m_Name: TrashBag
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Data.ProjectileData
|
||||
projectileId: trash-bag
|
||||
prefab: {fileID: 4015519405310386481, guid: 177c683542fd63a4a9d7e7ecacea596f, type: 3}
|
||||
cooldownTurns: 2
|
||||
icon: {fileID: 8766740682603709380, guid: b0a0abcb5fec95649b581307eca6a444, type: 3}
|
||||
displayName:
|
||||
description:
|
||||
8
Assets/Data/Minigames/FortFight/TrashBag.asset.meta
Normal file
8
Assets/Data/Minigames/FortFight/TrashBag.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23c4aa179d002af4080ec9d7fa22d2ba
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
20
Assets/Data/Minigames/FortFight/Vacumm.asset
Normal file
20
Assets/Data/Minigames/FortFight/Vacumm.asset
Normal file
@@ -0,0 +1,20 @@
|
||||
%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: 973f02063e5446598db4cbffdbf8f113, type: 3}
|
||||
m_Name: Vacumm
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Data.ProjectileData
|
||||
projectileId: vacumm
|
||||
prefab: {fileID: 4015519405310386481, guid: 4ffc718ecbe281041bc8354567f6e940, type: 3}
|
||||
cooldownTurns: 2
|
||||
icon: {fileID: 3452003437791708593, guid: 4c13556eeb918624c9dd3d7e4086242e, type: 3}
|
||||
displayName:
|
||||
description:
|
||||
8
Assets/Data/Minigames/FortFight/Vacumm.asset.meta
Normal file
8
Assets/Data/Minigames/FortFight/Vacumm.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 457fd1232d5781743a87fc2a308e9446
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -25,3 +25,5 @@ MonoBehaviour:
|
||||
requiredOrientation: 1
|
||||
- sceneName: StatueDecoration
|
||||
requiredOrientation: 1
|
||||
- sceneName: FortFight
|
||||
requiredOrientation: 1
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace AppleHills.Core.Settings.Editor
|
||||
{
|
||||
private Vector2 scrollPosition;
|
||||
private List<BaseDeveloperSettings> allDeveloperSettings = new List<BaseDeveloperSettings>();
|
||||
private string[] tabNames = new string[] { "Diving", "Debug", "Other Systems" }; // Added Debug tab
|
||||
private string[] tabNames = new string[] { "Diving", "Fort Fight", "Debug", "Other Systems" };
|
||||
private int selectedTab = 0;
|
||||
private Dictionary<string, SerializedObject> serializedSettingsObjects = new Dictionary<string, SerializedObject>();
|
||||
private GUIStyle headerStyle;
|
||||
@@ -45,6 +45,7 @@ namespace AppleHills.Core.Settings.Editor
|
||||
|
||||
// If any settings are missing, create them
|
||||
CreateSettingsIfMissing<DivingDeveloperSettings>("DivingDeveloperSettings");
|
||||
CreateSettingsIfMissing<FortFightDeveloperSettings>("FortFightDeveloperSettings");
|
||||
CreateSettingsIfMissing<DebugSettings>("DebugSettings");
|
||||
|
||||
// Add more developer settings types here as needed
|
||||
@@ -114,10 +115,13 @@ namespace AppleHills.Core.Settings.Editor
|
||||
case 0: // Diving
|
||||
DrawSettingsEditor<DivingDeveloperSettings>();
|
||||
break;
|
||||
case 1: // Debug
|
||||
case 1: // Fort Fight
|
||||
DrawSettingsEditor<FortFightDeveloperSettings>();
|
||||
break;
|
||||
case 2: // Debug
|
||||
DrawSettingsEditor<DebugSettings>();
|
||||
break;
|
||||
case 2: // Other Systems
|
||||
case 3: // Other Systems
|
||||
EditorGUILayout.HelpBox("Other developer settings will appear here as they are added.", MessageType.Info);
|
||||
break;
|
||||
// Add additional cases as more developer settings types are added
|
||||
|
||||
@@ -10,20 +10,27 @@ namespace AppleHills.Editor
|
||||
[InitializeOnLoad]
|
||||
public static class EditorSettingsProvider
|
||||
{
|
||||
// Gameplay Settings
|
||||
private static PlayerFollowerSettings _playerFollowerSettings;
|
||||
private static InteractionSettings _interactionSettings;
|
||||
private static DivingMinigameSettings _divingMinigameSettings;
|
||||
private static Minigames.FortFight.Core.FortFightSettings _fortFightSettings;
|
||||
|
||||
// Developer Settings
|
||||
private static FortFightDeveloperSettings _fortFightDeveloperSettings;
|
||||
private static DivingDeveloperSettings _divingDeveloperSettings;
|
||||
|
||||
// Static constructor will be called when Unity loads/reloads scripts
|
||||
static EditorSettingsProvider()
|
||||
{
|
||||
LoadAllSettings();
|
||||
|
||||
// Set up the delegates in SettingsAccess
|
||||
// Set up the delegates in SettingsAccess (includes Fort Fight)
|
||||
AppleHills.SettingsAccess.SetupEditorProviders(
|
||||
GetPlayerStopDistance,
|
||||
GetPlayerStopDistanceDirectInteraction,
|
||||
GetPuzzlePromptRange
|
||||
GetPuzzlePromptRange,
|
||||
GetWeakPointExplosionRadius
|
||||
);
|
||||
|
||||
// Subscribe to asset changes to auto-refresh when settings are modified
|
||||
@@ -52,15 +59,22 @@ namespace AppleHills.Editor
|
||||
|
||||
public static void LoadAllSettings()
|
||||
{
|
||||
// Load gameplay settings
|
||||
_playerFollowerSettings = AssetDatabase.LoadAssetAtPath<PlayerFollowerSettings>("Assets/Settings/PlayerFollowerSettings.asset");
|
||||
_interactionSettings = AssetDatabase.LoadAssetAtPath<InteractionSettings>("Assets/Settings/InteractionSettings.asset");
|
||||
_divingMinigameSettings = AssetDatabase.LoadAssetAtPath<DivingMinigameSettings>("Assets/Settings/MinigameSettings.asset");
|
||||
_fortFightSettings = AssetDatabase.LoadAssetAtPath<Minigames.FortFight.Core.FortFightSettings>("Assets/Settings/FortFightSettings.asset");
|
||||
|
||||
// Load developer settings
|
||||
_fortFightDeveloperSettings = AssetDatabase.LoadAssetAtPath<FortFightDeveloperSettings>("Assets/Settings/Developer/FortFightDeveloperSettings.asset");
|
||||
_divingDeveloperSettings = AssetDatabase.LoadAssetAtPath<DivingDeveloperSettings>("Assets/Settings/Developer/DivingDeveloperSettings.asset");
|
||||
|
||||
// Re-register the delegates in case they were lost
|
||||
AppleHills.SettingsAccess.SetupEditorProviders(
|
||||
GetPlayerStopDistance,
|
||||
GetPlayerStopDistanceDirectInteraction,
|
||||
GetPuzzlePromptRange
|
||||
GetPuzzlePromptRange,
|
||||
GetWeakPointExplosionRadius
|
||||
);
|
||||
|
||||
Logging.Debug("Editor settings loaded for Scene View use");
|
||||
@@ -88,6 +102,12 @@ namespace AppleHills.Editor
|
||||
return _interactionSettings?.DefaultPuzzlePromptRange ?? 3.0f;
|
||||
}
|
||||
|
||||
// Fort Fight delegate methods
|
||||
private static float GetWeakPointExplosionRadius()
|
||||
{
|
||||
return _fortFightSettings?.WeakPointExplosionRadius ?? 2.5f;
|
||||
}
|
||||
|
||||
// Other utility methods
|
||||
public static T GetSettings<T>() where T : BaseSettings
|
||||
{
|
||||
@@ -97,6 +117,21 @@ namespace AppleHills.Editor
|
||||
return _interactionSettings as T;
|
||||
else if (typeof(T) == typeof(DivingMinigameSettings))
|
||||
return _divingMinigameSettings as T;
|
||||
else if (typeof(T) == typeof(Minigames.FortFight.Core.FortFightSettings))
|
||||
return _fortFightSettings as T;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get developer settings in editor mode (for OnDrawGizmos, etc.)
|
||||
/// </summary>
|
||||
public static T GetDeveloperSettings<T>() where T : BaseDeveloperSettings
|
||||
{
|
||||
if (typeof(T) == typeof(FortFightDeveloperSettings))
|
||||
return _fortFightDeveloperSettings as T;
|
||||
else if (typeof(T) == typeof(DivingDeveloperSettings))
|
||||
return _divingDeveloperSettings as T;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace AppleHills.Core.Settings.Editor
|
||||
{
|
||||
private Vector2 scrollPosition;
|
||||
private List<BaseSettings> allSettings = new List<BaseSettings>();
|
||||
private string[] tabNames = new string[] { "Player & Follower", "Interaction & Items", "Diving Minigame", "Card System", "Card Sorting", "Bird Pooper", "Statue Dressup" };
|
||||
private string[] tabNames = new string[] { "Player & Follower", "Interaction & Items", "Diving Minigame", "Card System", "Card Sorting", "Bird Pooper", "Statue Dressup", "Fort Fight" };
|
||||
private int selectedTab = 0;
|
||||
private Dictionary<string, SerializedObject> serializedSettingsObjects = new Dictionary<string, SerializedObject>();
|
||||
private GUIStyle headerStyle;
|
||||
@@ -52,6 +52,7 @@ namespace AppleHills.Core.Settings.Editor
|
||||
CreateSettingsIfMissing<CardSortingSettings>("CardSortingSettings");
|
||||
CreateSettingsIfMissing<BirdPooperSettings>("BirdPooperSettings");
|
||||
CreateSettingsIfMissing<StatueDressupSettings>("StatueDressupSettings");
|
||||
CreateSettingsIfMissing<Minigames.FortFight.Core.FortFightSettings>("FortFightSettings");
|
||||
}
|
||||
|
||||
private void CreateSettingsIfMissing<T>(string fileName) where T : BaseSettings
|
||||
@@ -130,6 +131,9 @@ namespace AppleHills.Core.Settings.Editor
|
||||
case 6: // Statue Dressup
|
||||
DrawSettingsEditor<StatueDressupSettings>();
|
||||
break;
|
||||
case 7: // Fort Fight
|
||||
DrawSettingsEditor<Minigames.FortFight.Core.FortFightSettings>();
|
||||
break;
|
||||
}
|
||||
|
||||
EditorGUILayout.EndScrollView();
|
||||
|
||||
8
Assets/Prefabs/Minigames/FortFight.meta
Normal file
8
Assets/Prefabs/Minigames/FortFight.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44868bc8b3350d94fb55014db90c912d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Prefabs/Minigames/FortFight/Blocks.meta
Normal file
8
Assets/Prefabs/Minigames/FortFight/Blocks.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a1aef5c4f1311742ad0f7272dc50443
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
220
Assets/Prefabs/Minigames/FortFight/Blocks/BaseBlock.prefab
Normal file
220
Assets/Prefabs/Minigames/FortFight/Blocks/BaseBlock.prefab
Normal file
@@ -0,0 +1,220 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7086906997932553204
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4854439941706829338}
|
||||
- component: {fileID: 1733951774359296854}
|
||||
m_Layer: 0
|
||||
m_Name: SpriteRenderer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4854439941706829338
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7086906997932553204}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0.0045017465, w: 0.99998987}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 2, y: 2, z: 2}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6512041784125052745}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -0.516}
|
||||
--- !u!212 &1733951774359296854
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7086906997932553204}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: -4331849829665928538, guid: 8be45455b29f80241a3b8aae36291752, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 0.16, y: 0.16}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &7520512795364559713
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6512041784125052745}
|
||||
- component: {fileID: 2825398552764198077}
|
||||
- component: {fileID: 3408275740391398529}
|
||||
- component: {fileID: 7748443280095270292}
|
||||
m_Layer: 0
|
||||
m_Name: BaseBlock
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6512041784125052745
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7520512795364559713}
|
||||
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: 4854439941706829338}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!50 &2825398552764198077
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7520512795364559713}
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_GravityScale: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
m_Constraints: 0
|
||||
--- !u!61 &3408275740391398529
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7520512795364559713}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0.01736021, y: 0.008680344}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0, y: 0}
|
||||
oldSize: {x: 0, y: 0}
|
||||
newSize: {x: 0, y: 0}
|
||||
adaptiveTilingThreshold: 0
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 5.3053894, y: 2.093708}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!114 &7748443280095270292
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7520512795364559713}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ace8ce8bea324389a9955e63081ccff7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Fort.FortBlock
|
||||
material: 0
|
||||
size: 1
|
||||
isWeakPoint: 0
|
||||
explosionRadius: 2.5
|
||||
explosionDamage: 50
|
||||
weakPointVisualIndicator: {fileID: 0}
|
||||
explosionEffectPrefab: {fileID: 0}
|
||||
spriteRenderer: {fileID: 1733951774359296854}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 415d91c38289d6d48b9e02617c0077ff
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &5808897296274173900
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.b
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.g
|
||||
value: 0.7391078
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.r
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7520512795364559713, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: BaseBlock Variant
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a284fee98d5d9043ac5a6ae12b9be4a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
75
Assets/Prefabs/Minigames/FortFight/Blocks/Block_Glass.prefab
Normal file
75
Assets/Prefabs/Minigames/FortFight/Blocks/Block_Glass.prefab
Normal file
@@ -0,0 +1,75 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &3300878914999042762
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.b
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.g
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.r
|
||||
value: 0.68275356
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -1.46451
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.36305
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7520512795364559713, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: BaseBlock Variant
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7748443280095270292, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: material
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39e9717047cc0594aad150b00f191858
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
79
Assets/Prefabs/Minigames/FortFight/Blocks/Block_Steel.prefab
Normal file
79
Assets/Prefabs/Minigames/FortFight/Blocks/Block_Steel.prefab
Normal file
@@ -0,0 +1,79 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &3542555417085833802
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.b
|
||||
value: 0.990566
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.g
|
||||
value: 0.5618454
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.r
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -1.46451
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.36305
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7520512795364559713, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: BaseBlock Variant
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7748443280095270292, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: size
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7748443280095270292, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: material
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cdd6daf258d61574fbc64bed0f42daf9
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,79 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &4844830117807925294
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.b
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.g
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1733951774359296854, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Color.r
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -1.46451
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.36305
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6512041784125052745, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7520512795364559713, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: BaseBlock Variant
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7748443280095270292, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: isWeakPoint
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7748443280095270292, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
propertyPath: explosionRadius
|
||||
value: 5
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 415d91c38289d6d48b9e02617c0077ff, type: 3}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6985c12e95c1a814485e55be3d36a243
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Prefabs/Minigames/FortFight/Forts.meta
Normal file
8
Assets/Prefabs/Minigames/FortFight/Forts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c4af8148f9e1de458911c141d295db6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
387
Assets/Prefabs/Minigames/FortFight/Forts/SimpleFort.prefab
Normal file
387
Assets/Prefabs/Minigames/FortFight/Forts/SimpleFort.prefab
Normal file
@@ -0,0 +1,387 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2303456945894359403
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8064621895759812076}
|
||||
- component: {fileID: 8938858301725152068}
|
||||
m_Layer: 0
|
||||
m_Name: SimpleFort
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8064621895759812076
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2303456945894359403}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -0.04, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1731851162938573245}
|
||||
- {fileID: 7350060303235597263}
|
||||
- {fileID: 2023440682477717019}
|
||||
- {fileID: 7643340122397420652}
|
||||
- {fileID: 5247826848215981902}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &8938858301725152068
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2303456945894359403}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 05031222348c421ab564757f52f24952, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Fort.FortController
|
||||
fortName: SimpleFort
|
||||
showDebugInfo: 1
|
||||
--- !u!1001 &100308143899281775
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8064621895759812076}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2190174229508730571, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 10.338011
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2190174229508730571, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_Offset.x
|
||||
value: 0.077272415
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6446786228975401259, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Block_Steel (1)
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 6.54
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8248272390735150160, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 3.875
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8248272390735150160, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
--- !u!4 &7643340122397420652 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
m_PrefabInstance: {fileID: 100308143899281775}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &1265740765784495692
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8064621895759812076}
|
||||
m_Modifications:
|
||||
- target: {fileID: 5012833389701777835, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Block_Glass
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 3.83
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 2.6999998
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0.70710784
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0.70710576
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 90
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
--- !u!4 &7350060303235597263 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 8615518451581982083, guid: 39e9717047cc0594aad150b00f191858, type: 3}
|
||||
m_PrefabInstance: {fileID: 1265740765784495692}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &1354166924051577144
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8064621895759812076}
|
||||
m_Modifications:
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -3.76
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 2.76
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0.70710784
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0.70710576
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 90
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4090222677377819821, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Block_Cardboard
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
--- !u!4 &1731851162938573245 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 775237956681103493, guid: 2a284fee98d5d9043ac5a6ae12b9be4a, type: 3}
|
||||
m_PrefabInstance: {fileID: 1354166924051577144}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &5888217250810535977
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8064621895759812076}
|
||||
m_Modifications:
|
||||
- target: {fileID: 27624381625230900, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0.04000002
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 3.2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3126186265912943439, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Block_Weakpoint
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
--- !u!4 &5247826848215981902 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1829341962646880103, guid: 6985c12e95c1a814485e55be3d36a243, type: 3}
|
||||
m_PrefabInstance: {fileID: 5888217250810535977}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &8602561888576316184
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8064621895759812076}
|
||||
m_Modifications:
|
||||
- target: {fileID: 6446786228975401259, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Block_Steel
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 1.05
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
--- !u!4 &2023440682477717019 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7743593083879499011, guid: cdd6daf258d61574fbc64bed0f42daf9, type: 3}
|
||||
m_PrefabInstance: {fileID: 8602561888576316184}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1481432e299ad794e937cb82505cfbb2
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Prefabs/Minigames/FortFight/Projectiles.meta
Normal file
8
Assets/Prefabs/Minigames/FortFight/Projectiles.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c0e7378c10fea5438fb9161dcb55165
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8872d26b5cf881c48b49f19f62f057f0
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2da0db3ebb55914c84eca336cdde30e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,174 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4820392328973485589
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7720680877080653511}
|
||||
- component: {fileID: 7443668876430426293}
|
||||
- component: {fileID: 7264884308852669058}
|
||||
- component: {fileID: 4427156681582364024}
|
||||
- component: {fileID: 5656006159940088837}
|
||||
m_Layer: 0
|
||||
m_Name: Projecticle_Toaster
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7720680877080653511
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4820392328973485589}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -14.73, y: -5.69, z: 0}
|
||||
m_LocalScale: {x: 2.12, y: 2.12, z: 2.12}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!50 &7443668876430426293
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4820392328973485589}
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_GravityScale: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
m_Constraints: 0
|
||||
--- !u!58 &7264884308852669058
|
||||
CircleCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4820392328973485589}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Radius: 0.5
|
||||
--- !u!212 &4427156681582364024
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4820392328973485589}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 6674386295937086461, guid: 3bd1c178a78fcd144965cd1731dc309b, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 0.79, y: 0.62}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!114 &5656006159940088837
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4820392328973485589}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6ecf658b5965496abda845de1a28e227, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Projectiles.ToasterProjectile
|
||||
damage: 20
|
||||
mass: 1
|
||||
spriteRenderer: {fileID: 4427156681582364024}
|
||||
impactEffectPrefab: {fileID: 8132850146457957189, guid: 8872d26b5cf881c48b49f19f62f057f0, type: 3}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4b194a56edefa541b7c3bd7d70c8ba5
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,266 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4342087378442690536
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6135800783835399381}
|
||||
- component: {fileID: 8716398811558848928}
|
||||
- component: {fileID: 4840876230127075284}
|
||||
- component: {fileID: 5483057232976436363}
|
||||
- component: {fileID: 924610570851376059}
|
||||
m_Layer: 0
|
||||
m_Name: Projectile_Fan
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6135800783835399381
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4342087378442690536}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -14.73, y: -5.69, z: 0}
|
||||
m_LocalScale: {x: 2.12, y: 2.12, z: 2.12}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 1193836914283369334}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!50 &8716398811558848928
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4342087378442690536}
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_GravityScale: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
m_Constraints: 0
|
||||
--- !u!58 &4840876230127075284
|
||||
CircleCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4342087378442690536}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Radius: 0.5
|
||||
--- !u!212 &5483057232976436363
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4342087378442690536}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: -765527507412255412, guid: f70246e6148769846aaea223ec0c2a55, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 0.79, y: 0.62}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!114 &924610570851376059
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4342087378442690536}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e10ba9bd4bcd40da87ecb3efe5b78467, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Projectiles.CeilingFanProjectile
|
||||
spriteRenderer: {fileID: 5483057232976436363}
|
||||
impactEffectPrefab: {fileID: 8132850146457957189, guid: 8872d26b5cf881c48b49f19f62f057f0, type: 3}
|
||||
dropSpeed: 20
|
||||
dropDelay: 0.2
|
||||
indicator: {fileID: 7427261821782179495}
|
||||
--- !u!1 &7427261821782179495
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1193836914283369334}
|
||||
- component: {fileID: 4082675289326321460}
|
||||
m_Layer: 0
|
||||
m_Name: ArrowDown
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1193836914283369334
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7427261821782179495}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -1.09, z: 0}
|
||||
m_LocalScale: {x: 0.4078, y: 0.4078, z: 0.4078}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6135800783835399381}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &4082675289326321460
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7427261821782179495}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: -4346244404228752641, guid: 7b5d036a9fa30484e911f4752e3a64c8, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1.61, y: 3.08}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff8b62fb437256043aa6bd0b5441316b
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,173 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4015519405310386481
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1820106441296487268}
|
||||
- component: {fileID: 5065973586175064819}
|
||||
- component: {fileID: 5096150048676858183}
|
||||
- component: {fileID: 6069829950902409272}
|
||||
- component: {fileID: 6431354022734802106}
|
||||
m_Layer: 0
|
||||
m_Name: Projectile_Trash
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1820106441296487268
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -14.73, y: -5.69, z: 0}
|
||||
m_LocalScale: {x: 2.12, y: 2.12, z: 2.12}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!50 &5065973586175064819
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_GravityScale: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
m_Constraints: 0
|
||||
--- !u!58 &5096150048676858183
|
||||
CircleCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Radius: 0.5
|
||||
--- !u!212 &6069829950902409272
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 8766740682603709380, guid: b0a0abcb5fec95649b581307eca6a444, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 0.79, y: 0.62}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!114 &6431354022734802106
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b0996e59b91e48f8a542ab9294b11a74, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Projectiles.TrashBagProjectile
|
||||
spriteRenderer: {fileID: 6069829950902409272}
|
||||
impactEffectPrefab: {fileID: 0}
|
||||
trashPiecePrefab: {fileID: 2420282101973676341, guid: da828432c72519c41af1f118c1d2d32a, type: 3}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 177c683542fd63a4a9d7e7ecacea596f
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,179 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4015519405310386481
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1820106441296487268}
|
||||
- component: {fileID: 5065973586175064819}
|
||||
- component: {fileID: 5096150048676858183}
|
||||
- component: {fileID: 6069829950902409272}
|
||||
- component: {fileID: 6444071677531371543}
|
||||
m_Layer: 0
|
||||
m_Name: Projectile_Vacuum
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1820106441296487268
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -14.73, y: -5.69, z: 0}
|
||||
m_LocalScale: {x: 0.55, y: 0.55, z: 0.55}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!50 &5065973586175064819
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_GravityScale: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
m_Constraints: 0
|
||||
--- !u!58 &5096150048676858183
|
||||
CircleCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Radius: 1.47
|
||||
--- !u!212 &6069829950902409272
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 3452003437791708593, guid: 4c13556eeb918624c9dd3d7e4086242e, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 0.79, y: 0.62}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!114 &6444071677531371543
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4015519405310386481}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb85d181808c411b8bd1335aa7d35257, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Projectiles.VacuumProjectile
|
||||
damage: 20
|
||||
mass: 5
|
||||
spriteRenderer: {fileID: 6069829950902409272}
|
||||
impactEffectPrefab: {fileID: 8132850146457957189, guid: 8872d26b5cf881c48b49f19f62f057f0, type: 3}
|
||||
slideSpeed: 10
|
||||
slideDuration: 2
|
||||
groundLayer:
|
||||
serializedVersion: 2
|
||||
m_Bits: 16385
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ffc718ecbe281041bc8354567f6e940
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
171
Assets/Prefabs/Minigames/FortFight/Projectiles/TrashPiece.prefab
Normal file
171
Assets/Prefabs/Minigames/FortFight/Projectiles/TrashPiece.prefab
Normal file
@@ -0,0 +1,171 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2420282101973676341
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 241074338358760369}
|
||||
- component: {fileID: 5429206645950534442}
|
||||
- component: {fileID: 2897071451541676558}
|
||||
- component: {fileID: 5662209331708671128}
|
||||
- component: {fileID: 4567591556028898529}
|
||||
m_Layer: 15
|
||||
m_Name: TrashPiece
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &241074338358760369
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2420282101973676341}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -7.14251, y: -4.81934, z: 0}
|
||||
m_LocalScale: {x: 0.41, y: 0.41, z: 0.41}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &5429206645950534442
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2420282101973676341}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 4056058344551517612, guid: 389219560116e714283bd8edd52f125f, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 2.05, y: 1.36}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!50 &2897071451541676558
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2420282101973676341}
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_GravityScale: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
m_Constraints: 0
|
||||
--- !u!58 &5662209331708671128
|
||||
CircleCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2420282101973676341}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Radius: 1.025
|
||||
--- !u!114 &4567591556028898529
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2420282101973676341}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 516daf2ce7384aaa94fd5e0f7a3cf078, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.Projectiles.TrashPiece
|
||||
impactEffectPrefab: {fileID: 2996232906017550342, guid: e2da0db3ebb55914c84eca336cdde30e, type: 3}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da828432c72519c41af1f118c1d2d32a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Prefabs/Minigames/FortFight/UI.meta
Normal file
8
Assets/Prefabs/Minigames/FortFight/UI.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ea69ab311a50bf4fa62ee52b49ec12c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
617
Assets/Prefabs/Minigames/FortFight/UI/AmmoButton.prefab
Normal file
617
Assets/Prefabs/Minigames/FortFight/UI/AmmoButton.prefab
Normal file
@@ -0,0 +1,617 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2531541943888059757
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5547347229024929185}
|
||||
- component: {fileID: 5401206366902621396}
|
||||
m_Layer: 5
|
||||
m_Name: AmmoButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5547347229024929185
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2531541943888059757}
|
||||
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: 8404601832845600546}
|
||||
- {fileID: 5209091951854750408}
|
||||
- {fileID: 7509790308074872949}
|
||||
- {fileID: 5308022048675937646}
|
||||
- {fileID: 5860665860160112256}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 250}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &5401206366902621396
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2531541943888059757}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d18726bad651464fbc4e49f8c95c0c37, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.UI.AmmoButton
|
||||
iconImage: {fileID: 1292715515741235591}
|
||||
cooldownBackgroundImage: {fileID: 6649587367082175822}
|
||||
cooldownFillImage: {fileID: 4230072852917573804}
|
||||
turnsRemainingText: {fileID: 9017755476257925041}
|
||||
button: {fileID: 7156561986366282969}
|
||||
selectedIndicator: {fileID: 4902599675820783363}
|
||||
--- !u!1 &3901870519506060674
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7509790308074872949}
|
||||
- component: {fileID: 2705585925341768566}
|
||||
- component: {fileID: 6649587367082175822}
|
||||
- component: {fileID: 8175154043102998346}
|
||||
m_Layer: 5
|
||||
m_Name: CooldownBackground
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7509790308074872949
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3901870519506060674}
|
||||
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: 5547347229024929185}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2705585925341768566
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3901870519506060674}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6649587367082175822
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3901870519506060674}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.39215687}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -375496539, guid: 91cb3ae9a614f914997704a638d8b514, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 0
|
||||
m_FillOrigin: 2
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &8175154043102998346
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3901870519506060674}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
||||
m_AspectMode: 3
|
||||
m_AspectRatio: 1
|
||||
--- !u!1 &4902599675820783363
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8404601832845600546}
|
||||
- component: {fileID: 7897441411349867904}
|
||||
- component: {fileID: 7539021912128058554}
|
||||
- component: {fileID: 8444687236839044743}
|
||||
m_Layer: 5
|
||||
m_Name: Glow
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8404601832845600546
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4902599675820783363}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1.73, y: 1.73, z: 1.73}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5547347229024929185}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7897441411349867904
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4902599675820783363}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7539021912128058554
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4902599675820783363}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -8836962644236845764, guid: c5cc7367a37a7944abb3876352b0e0ff, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &8444687236839044743
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4902599675820783363}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
||||
m_AspectMode: 3
|
||||
m_AspectRatio: 1
|
||||
--- !u!1 &5631747237242774678
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5860665860160112256}
|
||||
- component: {fileID: 553452135861179838}
|
||||
- component: {fileID: 9017755476257925041}
|
||||
- component: {fileID: 3204967838938883920}
|
||||
m_Layer: 5
|
||||
m_Name: CooldownCount
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5860665860160112256
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5631747237242774678}
|
||||
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: 5547347229024929185}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &553452135861179838
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5631747237242774678}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &9017755476257925041
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5631747237242774678}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: 5
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 4aca0db6ec111b5418bdc747168f9474, type: 2}
|
||||
m_sharedMaterial: {fileID: -1441574381962284772, guid: 4aca0db6ec111b5418bdc747168f9474, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 100
|
||||
m_fontSizeBase: 100
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 1
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_TextWrappingMode: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 0
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_EmojiFallbackSupport: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!114 &3204967838938883920
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5631747237242774678}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
||||
m_AspectMode: 3
|
||||
m_AspectRatio: 1
|
||||
--- !u!1 &5744229847348998137
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5308022048675937646}
|
||||
- component: {fileID: 7806188825550789684}
|
||||
- component: {fileID: 4230072852917573804}
|
||||
- component: {fileID: 5298362292334641366}
|
||||
m_Layer: 5
|
||||
m_Name: CooldownFill
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5308022048675937646
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5744229847348998137}
|
||||
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: 5547347229024929185}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7806188825550789684
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5744229847348998137}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &4230072852917573804
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5744229847348998137}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.39215687}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -375496539, guid: 91cb3ae9a614f914997704a638d8b514, type: 3}
|
||||
m_Type: 3
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 0
|
||||
m_FillOrigin: 2
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &5298362292334641366
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5744229847348998137}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
||||
m_AspectMode: 3
|
||||
m_AspectRatio: 1
|
||||
--- !u!1 &6375846952096027156
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5209091951854750408}
|
||||
- component: {fileID: 333739704463047820}
|
||||
- component: {fileID: 2948614565164427980}
|
||||
- component: {fileID: 1292715515741235591}
|
||||
- component: {fileID: 7156561986366282969}
|
||||
m_Layer: 5
|
||||
m_Name: Visual
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5209091951854750408
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6375846952096027156}
|
||||
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: 5547347229024929185}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &333739704463047820
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6375846952096027156}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
||||
m_AspectMode: 3
|
||||
m_AspectRatio: 1
|
||||
--- !u!222 &2948614565164427980
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6375846952096027156}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1292715515741235591
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6375846952096027156}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &7156561986366282969
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6375846952096027156}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Button
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 1292715515741235591}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 009a94a95f1662441bf9e52311bfbd70
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
863
Assets/Prefabs/Minigames/FortFight/UI/Player_AmmoPanel.prefab
Normal file
863
Assets/Prefabs/Minigames/FortFight/UI/Player_AmmoPanel.prefab
Normal file
@@ -0,0 +1,863 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &6730781524121181368
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2148236734266076239}
|
||||
- component: {fileID: 1621117865532798199}
|
||||
- component: {fileID: 1107058815159810064}
|
||||
m_Layer: 5
|
||||
m_Name: Player_AmmoPanel
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2148236734266076239
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6730781524121181368}
|
||||
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: 4741534808117833349}
|
||||
- {fileID: 807375318505295058}
|
||||
- {fileID: 4535308774383573099}
|
||||
- {fileID: 3766327015481308810}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: -50, y: 50}
|
||||
m_SizeDelta: {x: 700, y: 150}
|
||||
m_Pivot: {x: 1, y: 0}
|
||||
--- !u!114 &1621117865532798199
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6730781524121181368}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.HorizontalLayoutGroup
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 4
|
||||
m_Spacing: 50
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 1
|
||||
m_ChildControlHeight: 0
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &1107058815159810064
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6730781524121181368}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1963617e4d104c199c3a66d671b8d8a2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.UI.AmmunitionPanel
|
||||
playerIndex: 0
|
||||
ammunitionManager: {fileID: 0}
|
||||
slingshotController: {fileID: 0}
|
||||
turnManager: {fileID: 0}
|
||||
ammoButtons:
|
||||
- {fileID: 5171683449295814640}
|
||||
- {fileID: 953793249169202599}
|
||||
- {fileID: 4105159935502846238}
|
||||
- {fileID: 3624408192042149887}
|
||||
panelRoot: {fileID: 6730781524121181368}
|
||||
--- !u!1001 &950666481065274148
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 2148236734266076239}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2531541943888059757, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: AmmoButton
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 250
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
--- !u!224 &4741534808117833349 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
m_PrefabInstance: {fileID: 950666481065274148}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &5171683449295814640 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 5401206366902621396, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
m_PrefabInstance: {fileID: 950666481065274148}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d18726bad651464fbc4e49f8c95c0c37, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.UI.AmmoButton
|
||||
--- !u!1001 &5172522139070908787
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 2148236734266076239}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2531541943888059757, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: AmmoButton2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 250
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
--- !u!224 &807375318505295058 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
m_PrefabInstance: {fileID: 5172522139070908787}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &953793249169202599 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 5401206366902621396, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
m_PrefabInstance: {fileID: 5172522139070908787}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d18726bad651464fbc4e49f8c95c0c37, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.UI.AmmoButton
|
||||
--- !u!1001 &8218090363695341002
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 2148236734266076239}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2531541943888059757, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: AmmoButton3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 250
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
--- !u!114 &4105159935502846238 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 5401206366902621396, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
m_PrefabInstance: {fileID: 8218090363695341002}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d18726bad651464fbc4e49f8c95c0c37, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.UI.AmmoButton
|
||||
--- !u!224 &4535308774383573099 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
m_PrefabInstance: {fileID: 8218090363695341002}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &8698857294231712555
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 2148236734266076239}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2531541943888059757, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: AmmoButton4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5209091951854750408, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5308022048675937646, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 250
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5860665860160112256, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7509790308074872949, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8404601832845600546, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
--- !u!114 &3624408192042149887 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 5401206366902621396, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
m_PrefabInstance: {fileID: 8698857294231712555}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d18726bad651464fbc4e49f8c95c0c37, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::Minigames.FortFight.UI.AmmoButton
|
||||
--- !u!224 &3766327015481308810 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 5547347229024929185, guid: 009a94a95f1662441bf9e52311bfbd70, type: 3}
|
||||
m_PrefabInstance: {fileID: 8698857294231712555}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2aa2fb2d3da8f3b4e9d1058cea4e418d
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@ using AppleHills.Core.Settings;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Input;
|
||||
using Minigames.FortFight.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Core
|
||||
@@ -173,6 +174,8 @@ namespace Core
|
||||
var sortingGameSettings = SettingsProvider.Instance.LoadSettingsSynchronous<CardSortingSettings>();
|
||||
var birdPooperSettings = SettingsProvider.Instance.LoadSettingsSynchronous<BirdPooperSettings>();
|
||||
var statueDressupSettings = SettingsProvider.Instance.LoadSettingsSynchronous<StatueDressupSettings>();
|
||||
var fortFightSettings = SettingsProvider.Instance.LoadSettingsSynchronous<FortFightSettings>();
|
||||
|
||||
|
||||
// Register settings with service locator
|
||||
if (playerSettings != null)
|
||||
@@ -245,9 +248,20 @@ namespace Core
|
||||
Debug.LogError("Failed to load StatueDressupSettings");
|
||||
}
|
||||
|
||||
if (fortFightSettings != null)
|
||||
{
|
||||
ServiceLocator.Register<IFortFightSettings>(fortFightSettings);
|
||||
Logging.Debug("FortFightSettings registered successfully");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Failed to load FortFightSettings");
|
||||
}
|
||||
|
||||
// Log success
|
||||
_settingsLoaded = playerSettings != null && interactionSettings != null && minigameSettings != null
|
||||
&& cardSystemSettings != null && birdPooperSettings != null && statueDressupSettings != null;
|
||||
&& cardSystemSettings != null && birdPooperSettings != null && statueDressupSettings != null
|
||||
&& fortFightSettings != null;
|
||||
if (_settingsLoaded)
|
||||
{
|
||||
Logging.Debug("All settings loaded and registered with ServiceLocator");
|
||||
@@ -312,5 +326,8 @@ namespace Core
|
||||
public float PlayerStopDistance => GetSettings<IInteractionSettings>()?.PlayerStopDistance ?? 6.0f;
|
||||
public float PlayerStopDistanceDirectInteraction => GetSettings<IInteractionSettings>()?.PlayerStopDistanceDirectInteraction ?? 2.0f;
|
||||
public float DefaultPuzzlePromptRange => GetSettings<IInteractionSettings>()?.DefaultPuzzlePromptRange ?? 3.0f;
|
||||
|
||||
// Fort Fight Settings
|
||||
public float WeakPointExplosionRadius => GetSettings<IFortFightSettings>()?.WeakPointExplosionRadius ?? 2.5f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppleHills.Core.Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// Developer settings for Fort Fight minigame technical configuration.
|
||||
/// These settings are separate from gameplay/design settings and focus on debugging and testing.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "FortFightDeveloperSettings", menuName = "AppleHills/Developer Settings/Fort Fight", order = 2)]
|
||||
public class FortFightDeveloperSettings : BaseDeveloperSettings
|
||||
{
|
||||
[Header("AI Debug Visualization")]
|
||||
[Tooltip("Show AI debug visuals (target circles, trajectory lines)")]
|
||||
[SerializeField] private bool showAIDebugVisuals = true;
|
||||
|
||||
[Tooltip("Color for AI target indicator")]
|
||||
[SerializeField] private Color aiDebugTargetColor = Color.red;
|
||||
|
||||
[Tooltip("Radius of AI target circle")]
|
||||
[SerializeField] private float aiDebugCircleRadius = 0.5f;
|
||||
|
||||
[Tooltip("Color for AI trajectory line")]
|
||||
[SerializeField] private Color aiDebugTrajectoryColor = Color.yellow;
|
||||
|
||||
[Header("Debug Logging")]
|
||||
[Tooltip("Show debug logs from SlingshotController")]
|
||||
[SerializeField] private bool slingshotShowDebugLogs = true;
|
||||
|
||||
[Tooltip("Show debug logs from AmmunitionManager")]
|
||||
[SerializeField] private bool ammunitionShowDebugLogs = true;
|
||||
|
||||
[Tooltip("Show debug info from FortController")]
|
||||
[SerializeField] private bool fortShowDebugInfo = true;
|
||||
|
||||
[Header("UI Debug Display")]
|
||||
[Tooltip("Show numerical HP values in FortHealthUI")]
|
||||
[SerializeField] private bool healthUIDebugDisplay = false;
|
||||
|
||||
[Header("Testing & Debug Prefabs")]
|
||||
[Tooltip("Debug prefab for player fort (testing purposes)")]
|
||||
[SerializeField] private GameObject debugPlayerFortPrefab;
|
||||
|
||||
[Tooltip("Debug prefab for enemy fort (testing purposes)")]
|
||||
[SerializeField] private GameObject debugEnemyFortPrefab;
|
||||
|
||||
// AI Debug Visualization properties
|
||||
public bool ShowAIDebugVisuals => showAIDebugVisuals;
|
||||
public Color AIDebugTargetColor => aiDebugTargetColor;
|
||||
public float AIDebugCircleRadius => aiDebugCircleRadius;
|
||||
public Color AIDebugTrajectoryColor => aiDebugTrajectoryColor;
|
||||
|
||||
// Debug Logging properties
|
||||
public bool SlingshotShowDebugLogs => slingshotShowDebugLogs;
|
||||
public bool AmmunitionShowDebugLogs => ammunitionShowDebugLogs;
|
||||
public bool FortShowDebugInfo => fortShowDebugInfo;
|
||||
|
||||
// UI Debug Display properties
|
||||
public bool HealthUIDebugDisplay => healthUIDebugDisplay;
|
||||
|
||||
// Testing & Debug Prefabs properties
|
||||
public GameObject DebugPlayerFortPrefab => debugPlayerFortPrefab;
|
||||
public GameObject DebugEnemyFortPrefab => debugEnemyFortPrefab;
|
||||
|
||||
public override void OnValidate()
|
||||
{
|
||||
base.OnValidate();
|
||||
|
||||
// Validate radius
|
||||
aiDebugCircleRadius = Mathf.Max(0.1f, aiDebugCircleRadius);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d354649c25014aa2a7b3b45841834f74
|
||||
timeCreated: 1764841328
|
||||
@@ -213,4 +213,70 @@ namespace AppleHills.Core.Settings
|
||||
string StateSaveKey { get; }
|
||||
int MaxSavedDecorations { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface for Fort Fight minigame settings
|
||||
/// </summary>
|
||||
public interface IFortFightSettings
|
||||
{
|
||||
// Block configurations
|
||||
System.Collections.Generic.List<Minigames.FortFight.Settings.BlockMaterialConfig> MaterialConfigs { get; }
|
||||
System.Collections.Generic.List<Minigames.FortFight.Settings.BlockSizeConfig> SizeConfigs { get; }
|
||||
|
||||
// AI Difficulty Settings
|
||||
Minigames.FortFight.Data.AIDifficulty DefaultAIDifficulty { get; } // Default difficulty level for AI
|
||||
Minigames.FortFight.Data.AIDifficultyData GetAIDifficultyData(Minigames.FortFight.Data.AIDifficulty difficulty);
|
||||
|
||||
// Weak point settings
|
||||
float WeakPointExplosionRadius { get; }
|
||||
float WeakPointExplosionDamage { get; }
|
||||
float WeakPointExplosionForce { get; }
|
||||
|
||||
// Fort settings
|
||||
float FortDefeatThreshold { get; }
|
||||
float PhysicsGravityScale { get; }
|
||||
|
||||
// Turn & Projectile timing
|
||||
float ProjectileSettleDelay { get; } // Time to wait after projectile stops moving before ending turn
|
||||
float TurnTransitionDelay { get; } // Additional delay during turn transition (wide view camera)
|
||||
|
||||
// Physics Settings
|
||||
float BlockGravityScale { get; } // Gravity scale for fort blocks
|
||||
float ProjectileGravityScale { get; } // Gravity scale for projectiles
|
||||
|
||||
// Physics Layers
|
||||
int FortBlockLayer { get; } // Layer index for fort blocks
|
||||
int ProjectileLayer { get; } // Layer index for projectiles
|
||||
|
||||
// Slingshot Settings
|
||||
float BaseLaunchForce { get; } // Base launch force multiplier
|
||||
float MinForceMultiplier { get; } // Minimum force required to launch (0-1)
|
||||
float MaxForceMultiplier { get; } // Maximum force cap (0-2, usually 1)
|
||||
float TrajectoryLockDuration { get; } // How long to show trajectory after launch
|
||||
|
||||
// Projectile Abilities
|
||||
float VacuumSlideSpeed { get; } // Constant velocity for vacuum sliding (m/s)
|
||||
int VacuumDestroyBlockCount { get; } // Blocks to destroy while sliding
|
||||
float VacuumBlockDamage { get; } // Damage dealt to blocks while sliding
|
||||
int TrashBagPieceCount { get; } // Pieces spawned on trash bag impact
|
||||
float TrashBagPieceForce { get; } // Force per trash piece
|
||||
float TrashBagSpreadAngle { get; } // Trash bag spread cone angle
|
||||
float TrashPieceDamage { get; } // Damage per trash piece on collision
|
||||
float TrashPieceLifetime { get; } // How long trash pieces persist (seconds)
|
||||
float CeilingFanActivationDelay { get; } // Delay before tap-to-drop becomes available
|
||||
float CeilingFanDropDelay { get; } // Pause before ceiling fan starts dropping
|
||||
float CeilingFanDropSpeed { get; } // Downward velocity when dropping (m/s)
|
||||
|
||||
// Projectile Configurations
|
||||
System.Collections.Generic.IReadOnlyList<Minigames.FortFight.Data.ProjectileConfig> ProjectileConfigs { get; }
|
||||
Minigames.FortFight.Data.ProjectileConfig GetProjectileConfig(Minigames.FortFight.Data.ProjectileType type);
|
||||
Minigames.FortFight.Data.ProjectileConfig GetProjectileConfigById(string projectileId);
|
||||
|
||||
// Visual settings
|
||||
Color DamageColorTint { get; }
|
||||
|
||||
// Helper methods
|
||||
Minigames.FortFight.Settings.BlockMaterialConfig GetMaterialConfig(Minigames.FortFight.Data.BlockMaterial material);
|
||||
Minigames.FortFight.Settings.BlockSizeConfig GetSizeConfig(Minigames.FortFight.Data.BlockSize size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,12 +15,14 @@ namespace AppleHills
|
||||
private static GetSettingsValueDelegate getPlayerStopDistanceProvider;
|
||||
private static GetSettingsValueDelegate getPlayerStopDistanceDirectInteractionProvider;
|
||||
private static GetSettingsValueDelegate getPuzzlePromptRangeProvider;
|
||||
private static GetSettingsValueDelegate getWeakPointExplosionRadiusProvider;
|
||||
|
||||
// Editor-only method to set up providers - will be called from editor code
|
||||
public static void SetupEditorProviders(
|
||||
GetSettingsValueDelegate playerStopDistanceProvider,
|
||||
GetSettingsValueDelegate playerStopDistanceDirectInteractionProvider,
|
||||
GetSettingsValueDelegate puzzlePromptRangeProvider)
|
||||
GetSettingsValueDelegate puzzlePromptRangeProvider,
|
||||
GetSettingsValueDelegate weakPointExplosionRadiusProvider)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
@@ -28,6 +30,7 @@ namespace AppleHills
|
||||
getPlayerStopDistanceProvider = playerStopDistanceProvider;
|
||||
getPlayerStopDistanceDirectInteractionProvider = playerStopDistanceDirectInteractionProvider;
|
||||
getPuzzlePromptRangeProvider = puzzlePromptRangeProvider;
|
||||
getWeakPointExplosionRadiusProvider = weakPointExplosionRadiusProvider;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -73,6 +76,49 @@ namespace AppleHills
|
||||
return GameManager.Instance.DefaultPuzzlePromptRange;
|
||||
}
|
||||
|
||||
// Fort Fight Settings
|
||||
public static float GetWeakPointExplosionRadius()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying && getWeakPointExplosionRadiusProvider != null)
|
||||
{
|
||||
return getWeakPointExplosionRadiusProvider();
|
||||
}
|
||||
#endif
|
||||
|
||||
return GameManager.Instance.WeakPointExplosionRadius;
|
||||
}
|
||||
|
||||
// Add more methods as needed for other settings
|
||||
|
||||
/// <summary>
|
||||
/// Get developer settings for editor-mode usage (OnDrawGizmos, etc.)
|
||||
/// This handles both editor and play mode seamlessly.
|
||||
/// </summary>
|
||||
public static T GetDeveloperSettingsForEditor<T>() where T : AppleHills.Core.Settings.BaseDeveloperSettings
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
// In editor mode (not playing), use reflection to access EditorSettingsProvider
|
||||
// This avoids direct reference to Editor assembly from runtime code
|
||||
var editorProviderType = System.Type.GetType("AppleHills.Editor.EditorSettingsProvider, Assembly-CSharp-Editor");
|
||||
if (editorProviderType != null)
|
||||
{
|
||||
var method = editorProviderType.GetMethod("GetDeveloperSettings",
|
||||
System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
|
||||
if (method != null)
|
||||
{
|
||||
var genericMethod = method.MakeGenericMethod(typeof(T));
|
||||
return genericMethod.Invoke(null, null) as T;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
#endif
|
||||
|
||||
// In play mode, use GameManager
|
||||
return GameManager.GetDeveloperSettings<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
Assets/Scripts/Minigames/FortFight.meta
Normal file
8
Assets/Scripts/Minigames/FortFight.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39b2d9cda7ea6d745a490a155fc6f9ca
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Scripts/Minigames/FortFight/AI.meta
Normal file
8
Assets/Scripts/Minigames/FortFight/AI.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fccff300fcb6488419e3871d8f59fb95
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
532
Assets/Scripts/Minigames/FortFight/AI/FortFightAIController.cs
Normal file
532
Assets/Scripts/Minigames/FortFight/AI/FortFightAIController.cs
Normal file
@@ -0,0 +1,532 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Minigames.FortFight.Core;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.Fort;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.AI
|
||||
{
|
||||
/// <summary>
|
||||
/// AI controller for Fort Fight opponent.
|
||||
/// Implements trajectory calculation, target selection, and shot execution with configurable difficulty.
|
||||
/// Includes debug visualization and thinking animations.
|
||||
/// </summary>
|
||||
public class FortFightAIController : ManagedBehaviour
|
||||
{
|
||||
#region Inspector Properties
|
||||
|
||||
[Header("AI References")]
|
||||
[SerializeField] private SlingshotController aiSlingshot;
|
||||
[Tooltip("Optional: Animator for AI character thinking animations")]
|
||||
[SerializeField] private Animator aiAnimator;
|
||||
|
||||
[Header("UI References")]
|
||||
[SerializeField] private GameObject thinkingIndicator;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private State
|
||||
|
||||
private TurnManager _turnManager;
|
||||
private AmmunitionManager _ammoManager;
|
||||
private FortManager _fortManager;
|
||||
private bool _isExecutingTurn = false;
|
||||
|
||||
// Current target info
|
||||
private FortBlock _targetBlock;
|
||||
private Vector2 _targetPosition;
|
||||
private ProjectileType _selectedAmmo;
|
||||
|
||||
// Settings cache
|
||||
private AppleHills.Core.Settings.IFortFightSettings _cachedSettings;
|
||||
private AppleHills.Core.Settings.FortFightDeveloperSettings _cachedDevSettings;
|
||||
private AIDifficultyData _currentDifficultyData;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Initialization
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the AI controller
|
||||
/// </summary>
|
||||
public void Initialize()
|
||||
{
|
||||
// Load settings
|
||||
_cachedSettings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
_cachedDevSettings = GameManager.GetDeveloperSettings<AppleHills.Core.Settings.FortFightDeveloperSettings>();
|
||||
|
||||
if (_cachedSettings == null)
|
||||
{
|
||||
Logging.Error("[FortFightAIController] Failed to load FortFightSettings!");
|
||||
}
|
||||
|
||||
// Load difficulty configuration from settings
|
||||
if (_cachedSettings != null)
|
||||
{
|
||||
AIDifficulty difficulty = _cachedSettings.DefaultAIDifficulty;
|
||||
_currentDifficultyData = _cachedSettings.GetAIDifficultyData(difficulty);
|
||||
Logging.Debug($"[FortFightAIController] Loaded AI difficulty: {difficulty} - Angle: ±{_currentDifficultyData.angleDeviation}°, Force: ±{_currentDifficultyData.forceDeviation * 100}%");
|
||||
}
|
||||
|
||||
// Get references to managers via singletons
|
||||
_turnManager = TurnManager.Instance;
|
||||
_ammoManager = AmmunitionManager.Instance;
|
||||
_fortManager = FortManager.Instance;
|
||||
|
||||
if (_turnManager == null)
|
||||
{
|
||||
Logging.Error("[FortFightAIController] TurnManager not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_ammoManager == null)
|
||||
{
|
||||
Logging.Error("[FortFightAIController] AmmunitionManager not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_fortManager == null)
|
||||
{
|
||||
Logging.Error("[FortFightAIController] FortManager not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (aiSlingshot == null)
|
||||
{
|
||||
Logging.Error("[FortFightAIController] AI Slingshot not assigned!");
|
||||
}
|
||||
|
||||
// Subscribe to turn events
|
||||
_turnManager.OnTurnStarted += OnTurnStarted;
|
||||
|
||||
bool debugVisualsEnabled = _cachedDevSettings?.ShowAIDebugVisuals ?? false;
|
||||
AIDifficulty activeDifficulty = _cachedSettings?.DefaultAIDifficulty ?? AIDifficulty.Medium;
|
||||
Logging.Debug($"[FortFightAIController] AI initialized - Difficulty: {activeDifficulty}, Debug Visuals: {debugVisualsEnabled}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Turn Handling
|
||||
|
||||
/// <summary>
|
||||
/// Called when a new turn starts
|
||||
/// </summary>
|
||||
private void OnTurnStarted(PlayerData currentPlayer, TurnState turnState)
|
||||
{
|
||||
// Only act if it's AI's turn
|
||||
if (turnState == TurnState.AITurn && !_isExecutingTurn)
|
||||
{
|
||||
StartCoroutine(ExecuteAITurn());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Execute the AI's turn with thinking phases and shot execution
|
||||
/// </summary>
|
||||
private IEnumerator ExecuteAITurn()
|
||||
{
|
||||
_isExecutingTurn = true;
|
||||
|
||||
Logging.Debug("[FortFightAIController] === AI TURN START ===");
|
||||
|
||||
// Phase 1: Thinking - Target Selection
|
||||
yield return StartCoroutine(ThinkingPhase("Analyzing targets..."));
|
||||
_targetBlock = SelectBestTarget();
|
||||
|
||||
if (_targetBlock == null)
|
||||
{
|
||||
Logging.Warning("[FortFightAIController] No valid target found! Skipping turn.");
|
||||
_isExecutingTurn = false;
|
||||
yield break;
|
||||
}
|
||||
|
||||
_targetPosition = _targetBlock.transform.position;
|
||||
Logging.Debug($"[FortFightAIController] Target selected: {_targetBlock.gameObject.name} at {_targetPosition}");
|
||||
|
||||
// Phase 2: Thinking - Ammunition Selection
|
||||
yield return StartCoroutine(ThinkingPhase("Selecting ammunition..."));
|
||||
_selectedAmmo = ChooseProjectile();
|
||||
Logging.Debug($"[FortFightAIController] Ammo selected: {_selectedAmmo}");
|
||||
|
||||
// Phase 3: Thinking - Trajectory Calculation
|
||||
yield return StartCoroutine(ThinkingPhase("Calculating trajectory..."));
|
||||
Vector2 launchVector = CalculateTrajectoryWithDeviation(aiSlingshot.transform.position, _targetPosition);
|
||||
Logging.Debug($"[FortFightAIController] Trajectory calculated: {launchVector}");
|
||||
|
||||
// Phase 4: Execute Shot
|
||||
yield return new WaitForSeconds(0.3f); // Brief pause before shot
|
||||
ExecuteShot(launchVector);
|
||||
|
||||
Logging.Debug("[FortFightAIController] === AI TURN SHOT EXECUTED ===");
|
||||
_isExecutingTurn = false;
|
||||
|
||||
// Turn will automatically end when projectile settles (handled by TurnManager)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Thinking phase with random duration and optional animation trigger
|
||||
/// </summary>
|
||||
private IEnumerator ThinkingPhase(string thinkingAction)
|
||||
{
|
||||
float thinkTime = Random.Range(_currentDifficultyData.thinkTimeMin, _currentDifficultyData.thinkTimeMax);
|
||||
Logging.Debug($"[FortFightAIController] {thinkingAction} ({thinkTime:F1}s)");
|
||||
|
||||
// TODO: Play some funny stuff here?
|
||||
// TODO: Placeholder "thinking" exlamation point
|
||||
if (thinkingIndicator != null)
|
||||
{
|
||||
thinkingIndicator.SetActive(true);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(thinkTime);
|
||||
|
||||
if (thinkingIndicator != null)
|
||||
{
|
||||
thinkingIndicator.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region AI Logic
|
||||
|
||||
/// <summary>
|
||||
/// Select the best target block to aim at
|
||||
/// Priority: Weak points > Low HP blocks > Random block
|
||||
/// </summary>
|
||||
private FortBlock SelectBestTarget()
|
||||
{
|
||||
if (_fortManager.PlayerFort == null)
|
||||
{
|
||||
Logging.Error("[FortFightAIController] Player fort not found!");
|
||||
return null;
|
||||
}
|
||||
|
||||
List<FortBlock> weakPoints = _fortManager.PlayerFort.GetWeakPoints();
|
||||
|
||||
// Priority 1: Target weak points
|
||||
if (weakPoints != null && weakPoints.Count > 0)
|
||||
{
|
||||
FortBlock target = weakPoints[Random.Range(0, weakPoints.Count)];
|
||||
Logging.Debug($"[FortFightAIController] Targeting weak point: {target.gameObject.name}");
|
||||
return target;
|
||||
}
|
||||
|
||||
// Priority 2: Target lowest HP block
|
||||
List<FortBlock> allBlocks = new List<FortBlock>();
|
||||
foreach (Transform child in _fortManager.PlayerFort.transform)
|
||||
{
|
||||
FortBlock block = child.GetComponent<FortBlock>();
|
||||
if (block != null && !block.IsDestroyed)
|
||||
{
|
||||
allBlocks.Add(block);
|
||||
}
|
||||
}
|
||||
|
||||
if (allBlocks.Count == 0)
|
||||
{
|
||||
Logging.Warning("[FortFightAIController] No blocks available to target!");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Sort by HP and pick from bottom 30%
|
||||
allBlocks.Sort((a, b) => a.CurrentHp.CompareTo(b.CurrentHp));
|
||||
int targetRange = Mathf.Max(1, allBlocks.Count / 3);
|
||||
FortBlock lowestHpTarget = allBlocks[Random.Range(0, targetRange)];
|
||||
|
||||
Logging.Debug($"[FortFightAIController] Targeting low HP block: {lowestHpTarget.gameObject.name} (HP: {lowestHpTarget.CurrentHp})");
|
||||
return lowestHpTarget;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Choose the best projectile type for current situation
|
||||
/// </summary>
|
||||
private ProjectileType ChooseProjectile()
|
||||
{
|
||||
// Get AI player index
|
||||
int playerIndex = _turnManager.CurrentPlayer.PlayerIndex;
|
||||
|
||||
// Get available projectiles (check cooldowns via ammo manager)
|
||||
var availableTypes = new List<ProjectileType>();
|
||||
foreach (ProjectileType type in System.Enum.GetValues(typeof(ProjectileType)))
|
||||
{
|
||||
// Check if ammo is available (not on cooldown)
|
||||
if (_ammoManager.IsAmmoAvailable(type, playerIndex))
|
||||
{
|
||||
availableTypes.Add(type);
|
||||
}
|
||||
}
|
||||
|
||||
if (availableTypes.Count == 0)
|
||||
{
|
||||
Logging.Warning("[FortFightAIController] No ammo available! Using Toaster as default.");
|
||||
return ProjectileType.Toaster;
|
||||
}
|
||||
|
||||
float enemyHpPercent = _fortManager.PlayerFort.HpPercentage;
|
||||
|
||||
// Strategic selection based on fort HP
|
||||
if (enemyHpPercent > 70f && availableTypes.Contains(ProjectileType.TrashBag))
|
||||
{
|
||||
return ProjectileType.TrashBag; // Spread damage early game
|
||||
}
|
||||
else if (enemyHpPercent > 40f && availableTypes.Contains(ProjectileType.Vacuum))
|
||||
{
|
||||
return ProjectileType.Vacuum; // Destruction machine mid-game
|
||||
}
|
||||
else if (_targetBlock != null && _targetBlock.IsWeakPoint && availableTypes.Contains(ProjectileType.CeilingFan))
|
||||
{
|
||||
return ProjectileType.CeilingFan; // Drop on weak points
|
||||
}
|
||||
|
||||
// Default to first available
|
||||
return availableTypes[Random.Range(0, availableTypes.Count)];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculate ballistic trajectory to hit target using proper parabolic flight physics
|
||||
/// Returns velocity vector needed to hit the target
|
||||
/// </summary>
|
||||
private Vector2 CalculateTrajectoryWithDeviation(Vector2 from, Vector2 to)
|
||||
{
|
||||
// Get gravity from Physics2D settings
|
||||
float gravity = Mathf.Abs(Physics2D.gravity.y);
|
||||
if (gravity < 0.1f) gravity = 9.81f; // Fallback to standard gravity
|
||||
|
||||
// Calculate displacement
|
||||
Vector2 displacement = to - from;
|
||||
float horizontalDist = displacement.x;
|
||||
float verticalDist = displacement.y;
|
||||
|
||||
// Calculate perfect launch velocity using ballistic trajectory equations
|
||||
// We'll use a 45-degree angle as base (optimal for distance) and adjust
|
||||
Vector2 perfectVelocity = CalculateBallisticVelocity(horizontalDist, verticalDist, gravity);
|
||||
|
||||
if (perfectVelocity == Vector2.zero)
|
||||
{
|
||||
// Fallback if physics calculation fails
|
||||
Logging.Warning("[FortFightAIController] Ballistic calculation failed, using fallback");
|
||||
perfectVelocity = displacement.normalized * 15f;
|
||||
}
|
||||
|
||||
// Apply difficulty-based deviation to velocity
|
||||
Vector2 deviatedVelocity = ApplyDeviation(perfectVelocity);
|
||||
|
||||
// Log detailed trajectory info
|
||||
float angle = Mathf.Atan2(deviatedVelocity.y, deviatedVelocity.x) * Mathf.Rad2Deg;
|
||||
float speed = deviatedVelocity.magnitude;
|
||||
Logging.Debug($"[FortFightAIController] Ballistic Trajectory: angle={angle:F1}°, speed={speed:F1} m/s, distance={displacement.magnitude:F1}m, gravity={gravity:F1}");
|
||||
|
||||
return deviatedVelocity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculate required velocity to hit target using ballistic equations
|
||||
/// Uses quadratic formula to solve for launch angle given distance and height
|
||||
/// </summary>
|
||||
private Vector2 CalculateBallisticVelocity(float dx, float dy, float gravity)
|
||||
{
|
||||
// Try multiple launch angles and pick the first valid solution
|
||||
// We prefer lower angles (30-60 degrees) for more direct shots
|
||||
float[] preferredAngles = { 45f, 40f, 50f, 35f, 55f, 30f, 60f };
|
||||
|
||||
foreach (float angleDegrees in preferredAngles)
|
||||
{
|
||||
float angleRad = angleDegrees * Mathf.Deg2Rad;
|
||||
|
||||
// Calculate required speed for this angle
|
||||
// Formula: v = sqrt((g * dx^2) / (2 * cos^2(θ) * (dx * tan(θ) - dy)))
|
||||
float cosTheta = Mathf.Cos(angleRad);
|
||||
float tanTheta = Mathf.Tan(angleRad);
|
||||
|
||||
float denominator = 2f * cosTheta * cosTheta * (dx * tanTheta - dy);
|
||||
|
||||
if (denominator > 0)
|
||||
{
|
||||
float speedSquared = (gravity * dx * dx) / denominator;
|
||||
|
||||
if (speedSquared > 0)
|
||||
{
|
||||
float speed = Mathf.Sqrt(speedSquared);
|
||||
|
||||
// Clamp speed to reasonable range (5-25 m/s)
|
||||
speed = Mathf.Clamp(speed, 5f, 25f);
|
||||
|
||||
// Calculate velocity components
|
||||
float vx = speed * cosTheta * Mathf.Sign(dx);
|
||||
float vy = speed * Mathf.Sin(angleRad);
|
||||
|
||||
return new Vector2(vx, vy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If no valid solution found, use simple physics
|
||||
// Estimate time of flight and calculate velocity
|
||||
float distance = Mathf.Sqrt(dx * dx + dy * dy);
|
||||
float estimatedTime = Mathf.Sqrt(2f * distance / gravity);
|
||||
|
||||
if (estimatedTime > 0)
|
||||
{
|
||||
float vx = dx / estimatedTime;
|
||||
float vy = dy / estimatedTime + 0.5f * gravity * estimatedTime;
|
||||
return new Vector2(vx, vy);
|
||||
}
|
||||
|
||||
return Vector2.zero;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply difficulty-based deviation to velocity
|
||||
/// </summary>
|
||||
private Vector2 ApplyDeviation(Vector2 perfectVelocity)
|
||||
{
|
||||
float angleDeviation = GetAngleDeviation();
|
||||
float speedDeviation = GetForceDeviation(); // Reuse for speed deviation
|
||||
|
||||
// Convert velocity to polar coordinates
|
||||
float speed = perfectVelocity.magnitude;
|
||||
float angle = Mathf.Atan2(perfectVelocity.y, perfectVelocity.x) * Mathf.Rad2Deg;
|
||||
|
||||
// Apply angle deviation
|
||||
angle += Random.Range(-angleDeviation, angleDeviation);
|
||||
|
||||
// Apply speed deviation
|
||||
speed *= Random.Range(1f - speedDeviation, 1f + speedDeviation);
|
||||
|
||||
// Convert back to cartesian
|
||||
float angleRad = angle * Mathf.Deg2Rad;
|
||||
return new Vector2(Mathf.Cos(angleRad), Mathf.Sin(angleRad)) * speed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get angle deviation based on current difficulty data
|
||||
/// </summary>
|
||||
private float GetAngleDeviation()
|
||||
{
|
||||
return _currentDifficultyData.angleDeviation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get force deviation based on current difficulty data
|
||||
/// </summary>
|
||||
private float GetForceDeviation()
|
||||
{
|
||||
return _currentDifficultyData.forceDeviation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Execute the shot by launching projectile from AI slingshot with calculated velocity
|
||||
/// </summary>
|
||||
private void ExecuteShot(Vector2 launchVelocity)
|
||||
{
|
||||
if (aiSlingshot == null)
|
||||
{
|
||||
Logging.Error("[FortFightAIController] AI Slingshot not assigned! Cannot execute shot.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Set ammunition type for AI player
|
||||
int playerIndex = _turnManager.CurrentPlayer.PlayerIndex;
|
||||
_ammoManager.SelectAmmo(_selectedAmmo, playerIndex);
|
||||
|
||||
// Get the selected ammo config and set it on the slingshot
|
||||
ProjectileConfig ammoConfig = _ammoManager.GetSelectedAmmoConfig(playerIndex);
|
||||
if (ammoConfig != null)
|
||||
{
|
||||
aiSlingshot.SetAmmo(ammoConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Error("[FortFightAIController] Failed to get ammo config!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Fire projectile using velocity-based launch (proper ballistic physics)
|
||||
aiSlingshot.LaunchWithVelocity(launchVelocity);
|
||||
|
||||
// Trigger shot animation if animator exists
|
||||
if (aiAnimator != null)
|
||||
{
|
||||
aiAnimator.SetTrigger("Shoot");
|
||||
}
|
||||
|
||||
Logging.Debug($"[FortFightAIController] Shot executed: {_selectedAmmo} with velocity {launchVelocity}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Debug Visualization
|
||||
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
// Get developer settings (works in both editor and play mode)
|
||||
var devSettings = AppleHills.SettingsAccess.GetDeveloperSettingsForEditor<AppleHills.Core.Settings.FortFightDeveloperSettings>();
|
||||
if (devSettings == null || !devSettings.ShowAIDebugVisuals) return;
|
||||
|
||||
// Only draw during play mode when AI is actively executing
|
||||
if (!Application.isPlaying) return;
|
||||
|
||||
// Draw target circle
|
||||
if (_targetBlock != null && _isExecutingTurn)
|
||||
{
|
||||
Gizmos.color = devSettings.AIDebugTargetColor;
|
||||
DrawCircle(_targetPosition, devSettings.AIDebugCircleRadius);
|
||||
|
||||
// Draw line from slingshot to target
|
||||
if (aiSlingshot != null)
|
||||
{
|
||||
Gizmos.color = devSettings.AIDebugTrajectoryColor;
|
||||
Gizmos.DrawLine(aiSlingshot.transform.position, _targetPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw a circle gizmo (approximation)
|
||||
/// </summary>
|
||||
private void DrawCircle(Vector2 center, float radius)
|
||||
{
|
||||
int segments = 32;
|
||||
float angleStep = 360f / segments;
|
||||
Vector3 prevPoint = center + new Vector2(radius, 0);
|
||||
|
||||
for (int i = 1; i <= segments; i++)
|
||||
{
|
||||
float angle = angleStep * i * Mathf.Deg2Rad;
|
||||
Vector3 newPoint = center + new Vector2(Mathf.Cos(angle), Mathf.Sin(angle)) * radius;
|
||||
Gizmos.DrawLine(prevPoint, newPoint);
|
||||
prevPoint = newPoint;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cleanup
|
||||
|
||||
internal override void OnManagedDestroy()
|
||||
{
|
||||
base.OnManagedDestroy();
|
||||
|
||||
if (_turnManager != null)
|
||||
{
|
||||
_turnManager.OnTurnStarted -= OnTurnStarted;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Future Implementation (Phase 4)
|
||||
|
||||
// TODO Phase 4: Implement ballistic trajectory calculation
|
||||
// TODO Phase 4: Implement target selection logic
|
||||
// TODO Phase 4: Implement shot deviation system
|
||||
// TODO Phase 4: Implement ammunition selection
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d82cbd88db94eec4ba7c19ef60b9fbbc
|
||||
8
Assets/Scripts/Minigames/FortFight/Core.meta
Normal file
8
Assets/Scripts/Minigames/FortFight/Core.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 461e23829a7d28547bfabd54136aff7b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
341
Assets/Scripts/Minigames/FortFight/Core/AmmunitionManager.cs
Normal file
341
Assets/Scripts/Minigames/FortFight/Core/AmmunitionManager.cs
Normal file
@@ -0,0 +1,341 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Minigames.FortFight.Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages ammunition selection and cooldowns for Fort Fight.
|
||||
/// Tracks which ammo types are available and handles cooldown timers.
|
||||
/// Singleton pattern for easy access throughout the game.
|
||||
/// </summary>
|
||||
public class AmmunitionManager : ManagedBehaviour
|
||||
{
|
||||
#region Singleton
|
||||
|
||||
private static AmmunitionManager _instance;
|
||||
public static AmmunitionManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = FindFirstObjectByType<AmmunitionManager>();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constants
|
||||
|
||||
private const int MaxPlayers = 2; // Support 2 players (indices 0 and 1)
|
||||
|
||||
#endregion
|
||||
|
||||
#region Inspector Properties
|
||||
|
||||
[Header("Configuration")]
|
||||
[Tooltip("Default projectile type selected at game start")]
|
||||
[SerializeField] private ProjectileType defaultProjectileType = ProjectileType.Toaster;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Settings
|
||||
|
||||
private IFortFightSettings _cachedSettings;
|
||||
private IFortFightSettings CachedSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedSettings == null)
|
||||
{
|
||||
_cachedSettings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
}
|
||||
return _cachedSettings;
|
||||
}
|
||||
}
|
||||
|
||||
private FortFightDeveloperSettings _cachedDevSettings;
|
||||
private FortFightDeveloperSettings CachedDevSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedDevSettings == null)
|
||||
{
|
||||
_cachedDevSettings = GameManager.GetDeveloperSettings<FortFightDeveloperSettings>();
|
||||
}
|
||||
return _cachedDevSettings;
|
||||
}
|
||||
}
|
||||
|
||||
private List<ProjectileConfig> AvailableConfigs
|
||||
{
|
||||
get
|
||||
{
|
||||
var settings = CachedSettings;
|
||||
return settings != null ? new List<ProjectileConfig>(settings.ProjectileConfigs) : new List<ProjectileConfig>();
|
||||
}
|
||||
}
|
||||
|
||||
private bool ShowDebugLogs => CachedDevSettings?.AmmunitionShowDebugLogs ?? false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Fired when ammo selection changes. Parameters: (ProjectileType selectedType, int playerIndex)
|
||||
/// </summary>
|
||||
public event Action<ProjectileType, int> OnAmmoSelected;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when ammo is used and enters cooldown. Parameters: (ProjectileType type, int cooldownTurns)
|
||||
/// </summary>
|
||||
public event Action<ProjectileType, int> OnAmmoCooldownStarted;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when ammo cooldown completes. Parameters: (ProjectileType type)
|
||||
/// </summary>
|
||||
public event Action<ProjectileType> OnAmmoCooldownCompleted;
|
||||
|
||||
#endregion
|
||||
|
||||
#region State
|
||||
|
||||
// Per-player ammunition state (encapsulates cooldowns, selection, usage)
|
||||
private Dictionary<int, PlayerAmmoState> _playerStates = new Dictionary<int, PlayerAmmoState>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Lifecycle
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
|
||||
// Register singleton
|
||||
if (_instance != null && _instance != this)
|
||||
{
|
||||
Logging.Warning("[AmmunitionManager] Multiple instances detected! Destroying duplicate.");
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedStart();
|
||||
|
||||
// Initialize player states
|
||||
var configs = AvailableConfigs;
|
||||
|
||||
for (int playerIndex = 0; playerIndex < MaxPlayers; playerIndex++)
|
||||
{
|
||||
// Create player state with default ammo
|
||||
_playerStates[playerIndex] = new PlayerAmmoState(playerIndex, defaultProjectileType);
|
||||
|
||||
// Initialize cooldowns for all projectile types
|
||||
foreach (var config in configs)
|
||||
{
|
||||
_playerStates[playerIndex].InitializeCooldown(config.projectileType);
|
||||
}
|
||||
|
||||
// Select default ammo (triggers event)
|
||||
SelectAmmo(defaultProjectileType, playerIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when a player's turn ends - decrements that player's cooldowns by 1 turn.
|
||||
/// Should be called by TurnManager on OnTurnEnded event.
|
||||
/// </summary>
|
||||
public void DecrementCooldowns(int playerIndex)
|
||||
{
|
||||
if (!_playerStates.ContainsKey(playerIndex))
|
||||
{
|
||||
Logging.Warning($"[AmmunitionManager] Player {playerIndex} state not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Decrement cooldowns and get completed types
|
||||
List<ProjectileType> completedCooldowns = _playerStates[playerIndex].DecrementCooldowns();
|
||||
|
||||
// Fire events for completed cooldowns
|
||||
var settings = CachedSettings;
|
||||
foreach (var type in completedCooldowns)
|
||||
{
|
||||
var config = settings?.GetProjectileConfig(type);
|
||||
if (config != null)
|
||||
{
|
||||
if (ShowDebugLogs) Logging.Debug($"[AmmunitionManager] Player {playerIndex}: {config.displayName} cooldown completed");
|
||||
OnAmmoCooldownCompleted?.Invoke(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ammo Selection
|
||||
|
||||
/// <summary>
|
||||
/// Select ammunition type for a specific player (if available - not on cooldown)
|
||||
/// </summary>
|
||||
public bool SelectAmmo(ProjectileType type, int playerIndex)
|
||||
{
|
||||
if (!_playerStates.ContainsKey(playerIndex))
|
||||
{
|
||||
Logging.Warning($"[AmmunitionManager] Player {playerIndex} state not found!");
|
||||
return false;
|
||||
}
|
||||
|
||||
var settings = CachedSettings;
|
||||
var config = settings?.GetProjectileConfig(type);
|
||||
|
||||
if (config == null)
|
||||
{
|
||||
Logging.Warning($"[AmmunitionManager] Projectile type {type} not found in settings");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!IsAmmoAvailable(type, playerIndex))
|
||||
{
|
||||
if (ShowDebugLogs) Logging.Debug($"[AmmunitionManager] Player {playerIndex}: {config.displayName} is on cooldown");
|
||||
return false;
|
||||
}
|
||||
|
||||
_playerStates[playerIndex].SelectedAmmo = type;
|
||||
if (ShowDebugLogs) Logging.Debug($"[AmmunitionManager] Player {playerIndex} selected: {config.displayName}");
|
||||
|
||||
OnAmmoSelected?.Invoke(type, playerIndex);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get currently selected projectile type for a specific player
|
||||
/// </summary>
|
||||
public ProjectileType GetSelectedAmmoType(int playerIndex)
|
||||
{
|
||||
if (_playerStates.ContainsKey(playerIndex))
|
||||
{
|
||||
return _playerStates[playerIndex].SelectedAmmo;
|
||||
}
|
||||
return defaultProjectileType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get currently selected projectile config for a specific player
|
||||
/// </summary>
|
||||
public ProjectileConfig GetSelectedAmmoConfig(int playerIndex)
|
||||
{
|
||||
var type = GetSelectedAmmoType(playerIndex);
|
||||
return CachedSettings?.GetProjectileConfig(type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if ammunition type is available for a specific player (not on cooldown)
|
||||
/// </summary>
|
||||
public bool IsAmmoAvailable(ProjectileType type, int playerIndex)
|
||||
{
|
||||
if (!_playerStates.ContainsKey(playerIndex))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return _playerStates[playerIndex].IsAmmoAvailable(type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get remaining cooldown turns for ammo for a specific player
|
||||
/// </summary>
|
||||
public int GetCooldownRemaining(ProjectileType type, int playerIndex)
|
||||
{
|
||||
if (!_playerStates.ContainsKey(playerIndex))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return _playerStates[playerIndex].GetCooldown(type);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ammo Usage
|
||||
|
||||
/// <summary>
|
||||
/// Use specific ammo for a specific player (trigger turn-based cooldown)
|
||||
/// </summary>
|
||||
public void UseAmmo(ProjectileType type, int playerIndex)
|
||||
{
|
||||
if (!_playerStates.ContainsKey(playerIndex))
|
||||
{
|
||||
Logging.Warning($"[AmmunitionManager] Player {playerIndex} state not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
var settings = CachedSettings;
|
||||
var config = settings?.GetProjectileConfig(type);
|
||||
|
||||
if (config == null)
|
||||
{
|
||||
Logging.Warning($"[AmmunitionManager] Projectile type {type} not found in settings");
|
||||
return;
|
||||
}
|
||||
|
||||
// Set cooldown and record usage
|
||||
_playerStates[playerIndex].SetCooldown(type, config.cooldownTurns);
|
||||
_playerStates[playerIndex].RecordUsage(type);
|
||||
|
||||
if (ShowDebugLogs) Logging.Debug($"[AmmunitionManager] Player {playerIndex}: {config.displayName} used - cooldown: {config.cooldownTurns} turns");
|
||||
|
||||
OnAmmoCooldownStarted?.Invoke(type, config.cooldownTurns);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public API
|
||||
|
||||
/// <summary>
|
||||
/// Reset all cooldowns for all players
|
||||
/// </summary>
|
||||
public void ResetAllCooldowns()
|
||||
{
|
||||
var configs = AvailableConfigs;
|
||||
|
||||
foreach (var playerState in _playerStates.Values)
|
||||
{
|
||||
foreach (var config in configs)
|
||||
{
|
||||
playerState.SetCooldown(config.projectileType, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ShowDebugLogs) Logging.Debug("[AmmunitionManager] All cooldowns reset for all players");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all available projectile types from settings
|
||||
/// </summary>
|
||||
public List<ProjectileType> GetAvailableProjectileTypes()
|
||||
{
|
||||
var types = new List<ProjectileType>();
|
||||
var configs = AvailableConfigs;
|
||||
foreach (var config in configs)
|
||||
{
|
||||
types.Add(config.projectileType);
|
||||
}
|
||||
return types;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4701ebc78fda468e9d8f3cf7fa7ee9f3
|
||||
timeCreated: 1764682641
|
||||
294
Assets/Scripts/Minigames/FortFight/Core/CameraController.cs
Normal file
294
Assets/Scripts/Minigames/FortFight/Core/CameraController.cs
Normal file
@@ -0,0 +1,294 @@
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Minigames.FortFight.Data;
|
||||
using Unity.Cinemachine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages camera states and transitions for the Fort Fight minigame.
|
||||
/// Subscribes to turn events and switches camera views accordingly.
|
||||
/// Uses Cinemachine for smooth camera blending.
|
||||
/// Singleton pattern for easy access.
|
||||
/// </summary>
|
||||
public class CameraController : ManagedBehaviour
|
||||
{
|
||||
#region Singleton
|
||||
|
||||
private static CameraController _instance;
|
||||
public static CameraController Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = FindFirstObjectByType<CameraController>();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Inspector References
|
||||
|
||||
[Header("Cinemachine Cameras")]
|
||||
[Tooltip("Virtual camera showing wide battlefield view (both forts)")]
|
||||
[SerializeField] private CinemachineCamera wideViewCamera;
|
||||
|
||||
[Tooltip("Player One's dedicated camera (position this in the scene for Player 1's view)")]
|
||||
[SerializeField] private CinemachineCamera playerOneCamera;
|
||||
|
||||
[Tooltip("Player Two's dedicated camera (position this in the scene for Player 2's view)")]
|
||||
[SerializeField] private CinemachineCamera playerTwoCamera;
|
||||
|
||||
[Tooltip("Camera that follows projectiles in flight (should have CinemachineFollow component)")]
|
||||
[SerializeField] private CinemachineCamera projectileCamera;
|
||||
|
||||
// Note: TurnManager accessed via singleton
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public CinemachineCamera WideViewCamera => wideViewCamera;
|
||||
public CinemachineCamera PlayerOneCamera => playerOneCamera;
|
||||
public CinemachineCamera PlayerTwoCamera => playerTwoCamera;
|
||||
public CinemachineCamera ProjectileCamera => projectileCamera;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Lifecycle
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
|
||||
// Register singleton
|
||||
if (_instance != null && _instance != this)
|
||||
{
|
||||
Logging.Warning("[CameraController] Multiple instances detected! Destroying duplicate.");
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
_instance = this;
|
||||
|
||||
// Validate references
|
||||
if (wideViewCamera == null)
|
||||
{
|
||||
Logging.Error("[CameraController] Wide view camera not assigned!");
|
||||
}
|
||||
|
||||
if (playerOneCamera == null)
|
||||
{
|
||||
Logging.Error("[CameraController] Player One camera not assigned!");
|
||||
}
|
||||
|
||||
if (playerTwoCamera == null)
|
||||
{
|
||||
Logging.Error("[CameraController] Player Two camera not assigned!");
|
||||
}
|
||||
|
||||
if (projectileCamera == null)
|
||||
{
|
||||
Logging.Warning("[CameraController] Projectile camera not assigned - projectiles won't be followed!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedStart();
|
||||
|
||||
// Subscribe to turn events via singleton
|
||||
if (TurnManager.Instance != null)
|
||||
{
|
||||
TurnManager.Instance.OnTurnStarted += HandleTurnStarted;
|
||||
TurnManager.Instance.OnTurnEnded += HandleTurnEnded;
|
||||
|
||||
Logging.Debug("[CameraController] Subscribed to turn events");
|
||||
}
|
||||
|
||||
// Start in wide view
|
||||
ShowWideView();
|
||||
}
|
||||
|
||||
internal override void OnManagedDestroy()
|
||||
{
|
||||
if (_instance == this)
|
||||
{
|
||||
_instance = null;
|
||||
}
|
||||
|
||||
base.OnManagedDestroy();
|
||||
|
||||
// Unsubscribe from events
|
||||
if (TurnManager.Instance != null)
|
||||
{
|
||||
TurnManager.Instance.OnTurnStarted -= HandleTurnStarted;
|
||||
TurnManager.Instance.OnTurnEnded -= HandleTurnEnded;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
/// <summary>
|
||||
/// Called when a player's turn starts - activate their dedicated camera
|
||||
/// </summary>
|
||||
private void HandleTurnStarted(PlayerData player, TurnState turnState)
|
||||
{
|
||||
Logging.Debug($"[CameraController] Turn started for {player.PlayerName} (Index: {player.PlayerIndex}, State: {turnState})");
|
||||
|
||||
// If transitioning, show wide view
|
||||
if (turnState == TurnState.TransitioningTurn)
|
||||
{
|
||||
ActivateCamera(wideViewCamera);
|
||||
return;
|
||||
}
|
||||
|
||||
// Activate the appropriate player camera based on player index
|
||||
if (player.PlayerIndex == 0)
|
||||
{
|
||||
// Player One's turn
|
||||
ActivateCamera(playerOneCamera);
|
||||
}
|
||||
else if (player.PlayerIndex == 1)
|
||||
{
|
||||
// Player Two's turn
|
||||
ActivateCamera(playerTwoCamera);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Warning($"[CameraController] Unknown player index: {player.PlayerIndex}, defaulting to wide view");
|
||||
ActivateCamera(wideViewCamera);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when a player's turn ends - camera switches handled by turn state changes
|
||||
/// </summary>
|
||||
private void HandleTurnEnded(PlayerData player)
|
||||
{
|
||||
Logging.Debug($"[CameraController] Turn ended for {player.PlayerName}");
|
||||
// Camera switching happens via OnTurnStarted when state changes to TransitioningTurn
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Activate a specific camera by setting its priority highest
|
||||
/// </summary>
|
||||
private void ActivateCamera(CinemachineCamera camera)
|
||||
{
|
||||
if (camera == null) return;
|
||||
|
||||
// Set all cameras to low priority
|
||||
if (wideViewCamera != null) wideViewCamera.Priority.Value = 10;
|
||||
if (playerOneCamera != null) playerOneCamera.Priority.Value = 10;
|
||||
if (playerTwoCamera != null) playerTwoCamera.Priority.Value = 10;
|
||||
if (projectileCamera != null) projectileCamera.Priority.Value = 10;
|
||||
|
||||
// Set target camera to high priority
|
||||
camera.Priority.Value = 20;
|
||||
|
||||
Logging.Debug($"[CameraController] Activated camera: {camera.gameObject.name}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Projectile Tracking
|
||||
|
||||
/// <summary>
|
||||
/// Start following a projectile with the projectile camera.
|
||||
/// Called when a projectile is launched.
|
||||
/// </summary>
|
||||
public void StartFollowingProjectile(Transform projectileTransform)
|
||||
{
|
||||
if (projectileCamera == null)
|
||||
{
|
||||
Logging.Warning("[CameraController] Cannot follow projectile - projectile camera not assigned!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (projectileTransform == null)
|
||||
{
|
||||
Logging.Warning("[CameraController] Cannot follow null projectile transform!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Verify CinemachineFollow component exists (optional check)
|
||||
var followComponent = projectileCamera.GetComponent<CinemachineFollow>();
|
||||
if (followComponent == null)
|
||||
{
|
||||
Logging.Error("[CameraController] Projectile camera missing CinemachineFollow component!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the follow target on the CinemachineCamera's Target property
|
||||
projectileCamera.Target.TrackingTarget = projectileTransform;
|
||||
|
||||
// Activate the projectile camera
|
||||
ActivateCamera(projectileCamera);
|
||||
|
||||
Logging.Debug($"[CameraController] Now following projectile: {projectileTransform.gameObject.name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop following the projectile and return to wide view.
|
||||
/// Called when projectile has settled.
|
||||
/// </summary>
|
||||
public void StopFollowingProjectile()
|
||||
{
|
||||
if (projectileCamera == null) return;
|
||||
|
||||
// Clear the follow target on the CinemachineCamera's Target property
|
||||
projectileCamera.Target.TrackingTarget = null;
|
||||
|
||||
// Return to wide view
|
||||
ActivateCamera(wideViewCamera);
|
||||
|
||||
Logging.Debug("[CameraController] Stopped following projectile, returned to wide view");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public API
|
||||
|
||||
/// <summary>
|
||||
/// Manually switch to wide view (useful for game start/end)
|
||||
/// </summary>
|
||||
public void ShowWideView()
|
||||
{
|
||||
ActivateCamera(wideViewCamera);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manually switch to a specific player's camera
|
||||
/// </summary>
|
||||
public void ShowPlayerCamera(int playerIndex)
|
||||
{
|
||||
if (playerIndex == 0)
|
||||
{
|
||||
ActivateCamera(playerOneCamera);
|
||||
}
|
||||
else if (playerIndex == 1)
|
||||
{
|
||||
ActivateCamera(playerTwoCamera);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Editor Helpers
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnValidate()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa30fcfc16ed44d59edd73fd0224d03c
|
||||
timeCreated: 1764674161
|
||||
386
Assets/Scripts/Minigames/FortFight/Core/FortFightGameManager.cs
Normal file
386
Assets/Scripts/Minigames/FortFight/Core/FortFightGameManager.cs
Normal file
@@ -0,0 +1,386 @@
|
||||
using System;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using Core.Lifecycle;
|
||||
using Minigames.FortFight.AI;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.UI;
|
||||
|
||||
namespace Minigames.FortFight.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Main game manager for Fort Fight minigame.
|
||||
/// Orchestrates game flow, mode selection, and coordinates between systems.
|
||||
/// Singleton pattern for easy access.
|
||||
/// </summary>
|
||||
public class FortFightGameManager : ManagedBehaviour
|
||||
{
|
||||
#region Singleton
|
||||
|
||||
private static FortFightGameManager _instance;
|
||||
public static FortFightGameManager Instance => _instance;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Inspector References
|
||||
|
||||
[Header("Core Systems")]
|
||||
[SerializeField] private FortFightAIController aiController;
|
||||
|
||||
[Header("UI References")]
|
||||
[SerializeField] private ModeSelectionPage modeSelectionPage;
|
||||
[SerializeField] private GameplayPage gameplayPage;
|
||||
[SerializeField] private UI.GameOverUI gameOverUI;
|
||||
|
||||
// Note: TurnManager and FortManager accessed via singletons
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Fired when game mode is selected and game is starting
|
||||
/// </summary>
|
||||
public event Action<FortFightGameMode> OnGameModeSelected;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the game actually starts (after mode selection)
|
||||
/// </summary>
|
||||
public event Action OnGameStarted;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when game ends
|
||||
/// </summary>
|
||||
public event Action OnGameEnded;
|
||||
|
||||
#endregion
|
||||
|
||||
#region State
|
||||
|
||||
private FortFightGameMode currentGameMode;
|
||||
private PlayerData playerOne;
|
||||
private PlayerData playerTwo;
|
||||
private bool isGameActive = false;
|
||||
private float gameStartTime = 0f;
|
||||
|
||||
public FortFightGameMode CurrentGameMode => currentGameMode;
|
||||
public bool IsGameActive => isGameActive;
|
||||
|
||||
/// <summary>
|
||||
/// Get elapsed game time in seconds since game started
|
||||
/// </summary>
|
||||
public float ElapsedGameTime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!isGameActive) return 0f;
|
||||
return Time.time - gameStartTime;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Lifecycle
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
|
||||
// Set singleton
|
||||
if (_instance != null && _instance != this)
|
||||
{
|
||||
Logging.Warning("[FortFightGameManager] Multiple instances detected! Destroying duplicate.");
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
_instance = this;
|
||||
|
||||
// Validate references
|
||||
ValidateReferences();
|
||||
}
|
||||
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedStart();
|
||||
|
||||
// Show mode selection page
|
||||
ShowModeSelection();
|
||||
}
|
||||
|
||||
internal override void OnManagedDestroy()
|
||||
{
|
||||
base.OnManagedDestroy();
|
||||
|
||||
// Unsubscribe from fort defeated events
|
||||
var fortManager = FortManager.Instance;
|
||||
if (fortManager != null)
|
||||
{
|
||||
if (fortManager.PlayerFort != null)
|
||||
{
|
||||
fortManager.PlayerFort.OnFortDefeated -= OnFortDefeated;
|
||||
}
|
||||
|
||||
if (fortManager.EnemyFort != null)
|
||||
{
|
||||
fortManager.EnemyFort.OnFortDefeated -= OnFortDefeated;
|
||||
}
|
||||
}
|
||||
|
||||
// Clear events
|
||||
OnGameModeSelected = null;
|
||||
OnGameStarted = null;
|
||||
OnGameEnded = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Validation
|
||||
|
||||
private void ValidateReferences()
|
||||
{
|
||||
if (aiController == null)
|
||||
{
|
||||
Logging.Warning("[FortFightGameManager] AIController reference not assigned! AI mode will not work.");
|
||||
}
|
||||
|
||||
if (modeSelectionPage == null)
|
||||
{
|
||||
Logging.Error("[FortFightGameManager] ModeSelectionPage reference not assigned!");
|
||||
}
|
||||
|
||||
if (gameplayPage == null)
|
||||
{
|
||||
Logging.Error("[FortFightGameManager] GameplayPage reference not assigned!");
|
||||
}
|
||||
|
||||
if (gameOverUI == null)
|
||||
{
|
||||
Logging.Error("[FortFightGameManager] GameOverUI reference not assigned!");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Game Flow
|
||||
|
||||
/// <summary>
|
||||
/// Show the mode selection screen
|
||||
/// </summary>
|
||||
private void ShowModeSelection()
|
||||
{
|
||||
if (modeSelectionPage != null)
|
||||
{
|
||||
modeSelectionPage.gameObject.SetActive(true);
|
||||
modeSelectionPage.TransitionIn();
|
||||
Logging.Debug("[FortFightGameManager] Showing mode selection page");
|
||||
}
|
||||
|
||||
// Hide other UI pages
|
||||
if (gameplayPage != null)
|
||||
{
|
||||
gameplayPage.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
if (gameOverUI != null)
|
||||
{
|
||||
gameOverUI.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when player selects a game mode
|
||||
/// </summary>
|
||||
public void SelectGameMode(FortFightGameMode mode)
|
||||
{
|
||||
currentGameMode = mode;
|
||||
|
||||
Logging.Debug($"[FortFightGameManager] Game mode selected: {mode}");
|
||||
OnGameModeSelected?.Invoke(mode);
|
||||
|
||||
// Initialize players based on mode
|
||||
InitializePlayers();
|
||||
|
||||
// Transition to gameplay
|
||||
StartGame();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize player data based on selected game mode
|
||||
/// </summary>
|
||||
private void InitializePlayers()
|
||||
{
|
||||
playerOne = new PlayerData("Player", false, 0);
|
||||
|
||||
if (currentGameMode == FortFightGameMode.SinglePlayer)
|
||||
{
|
||||
playerTwo = new PlayerData("PigMan AI", true, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
playerTwo = new PlayerData("Player 2", false, 1);
|
||||
}
|
||||
|
||||
Logging.Debug($"[FortFightGameManager] Players initialized - P1: {playerOne.PlayerName}, P2: {playerTwo.PlayerName}");
|
||||
|
||||
// Spawn forts for both players via singleton
|
||||
if (FortManager.Instance != null)
|
||||
{
|
||||
FortManager.Instance.SpawnForts();
|
||||
Logging.Debug("[FortFightGameManager] Forts spawned for both players");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Warning("[FortFightGameManager] FortManager not found! Forts will not spawn.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start the game
|
||||
/// </summary>
|
||||
private void StartGame()
|
||||
{
|
||||
// Hide mode selection, show gameplay
|
||||
if (modeSelectionPage != null)
|
||||
{
|
||||
modeSelectionPage.TransitionOut();
|
||||
}
|
||||
|
||||
if (gameplayPage != null)
|
||||
{
|
||||
gameplayPage.gameObject.SetActive(true);
|
||||
gameplayPage.TransitionIn();
|
||||
}
|
||||
|
||||
// Initialize turn manager via singleton
|
||||
if (TurnManager.Instance != null)
|
||||
{
|
||||
TurnManager.Instance.Initialize(playerOne, playerTwo);
|
||||
TurnManager.Instance.StartGame();
|
||||
}
|
||||
|
||||
// Initialize AI if in single player mode
|
||||
if (currentGameMode == FortFightGameMode.SinglePlayer && aiController != null)
|
||||
{
|
||||
aiController.Initialize();
|
||||
}
|
||||
|
||||
// Subscribe to fort defeated events (may need to wait for forts to spawn)
|
||||
StartCoroutine(SubscribeToFortEventsWhenReady());
|
||||
|
||||
isGameActive = true;
|
||||
gameStartTime = Time.time; // Start tracking elapsed time
|
||||
OnGameStarted?.Invoke();
|
||||
|
||||
Logging.Debug("[FortFightGameManager] Game started!");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wait for forts to be spawned and ready, then subscribe to their defeat events
|
||||
/// </summary>
|
||||
private System.Collections.IEnumerator SubscribeToFortEventsWhenReady()
|
||||
{
|
||||
Logging.Debug("[FortFightGameManager] Waiting for forts to be ready...");
|
||||
|
||||
var fortManager = FortManager.Instance;
|
||||
if (fortManager == null)
|
||||
{
|
||||
Logging.Error("[FortFightGameManager] FortManager not found! Cannot subscribe to fort events.");
|
||||
yield break;
|
||||
}
|
||||
|
||||
// Wait up to 5 seconds for forts to spawn
|
||||
float timeout = 5f;
|
||||
float elapsed = 0f;
|
||||
|
||||
while ((fortManager.PlayerFort == null || fortManager.EnemyFort == null) && elapsed < timeout)
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
elapsed += 0.1f;
|
||||
}
|
||||
|
||||
if (fortManager.PlayerFort == null || fortManager.EnemyFort == null)
|
||||
{
|
||||
Logging.Error($"[FortFightGameManager] Forts not ready after {timeout}s! PlayerFort: {fortManager.PlayerFort != null}, EnemyFort: {fortManager.EnemyFort != null}");
|
||||
yield break;
|
||||
}
|
||||
|
||||
// Subscribe to both forts
|
||||
Logging.Debug($"[FortFightGameManager] Forts ready! Subscribing to defeat events...");
|
||||
|
||||
fortManager.PlayerFort.OnFortDefeated += OnFortDefeated;
|
||||
fortManager.EnemyFort.OnFortDefeated += OnFortDefeated;
|
||||
|
||||
Logging.Debug($"[FortFightGameManager] Successfully subscribed to fort defeat events: PlayerFort={fortManager.PlayerFort.FortName}, EnemyFort={fortManager.EnemyFort.FortName}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when any fort is defeated
|
||||
/// </summary>
|
||||
private void OnFortDefeated()
|
||||
{
|
||||
Logging.Debug("[FortFightGameManager] Fort defeated, ending game...");
|
||||
EndGame();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// End the game and show game over UI
|
||||
/// </summary>
|
||||
public void EndGame()
|
||||
{
|
||||
if (!isGameActive)
|
||||
{
|
||||
Logging.Warning("[FortFightGameManager] EndGame called but game is not active");
|
||||
return;
|
||||
}
|
||||
|
||||
isGameActive = false;
|
||||
|
||||
// Stop turn manager
|
||||
if (TurnManager.Instance != null)
|
||||
{
|
||||
TurnManager.Instance.SetGameOver();
|
||||
}
|
||||
|
||||
// Manage UI transitions
|
||||
ShowGameOver();
|
||||
|
||||
OnGameEnded?.Invoke();
|
||||
|
||||
Logging.Debug("[FortFightGameManager] Game ended");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show game over UI and hide gameplay UI
|
||||
/// </summary>
|
||||
private void ShowGameOver()
|
||||
{
|
||||
// Hide gameplay page
|
||||
if (gameplayPage != null)
|
||||
{
|
||||
gameplayPage.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
// Show game over UI
|
||||
if (gameOverUI != null)
|
||||
{
|
||||
gameOverUI.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Error("[FortFightGameManager] Cannot show game over UI - reference not assigned!");
|
||||
}
|
||||
|
||||
// Switch camera to wide view
|
||||
var cameraController = CameraController.Instance;
|
||||
if (cameraController != null)
|
||||
{
|
||||
cameraController.ShowWideView();
|
||||
}
|
||||
|
||||
Logging.Debug("[FortFightGameManager] Game over UI shown");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 517ef0a4f14e16f42987a95684371b73
|
||||
279
Assets/Scripts/Minigames/FortFight/Core/FortFightSettings.cs
Normal file
279
Assets/Scripts/Minigames/FortFight/Core/FortFightSettings.cs
Normal file
@@ -0,0 +1,279 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AppleHills.Core.Settings;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.Settings;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Settings for the Fort Fight minigame.
|
||||
/// Contains all configurable gameplay values for balancing.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "FortFightSettings", menuName = "AppleHills/Settings/Fort Fight", order = 8)]
|
||||
public class FortFightSettings : BaseSettings, IFortFightSettings
|
||||
{
|
||||
[Header("Block Material Configurations")]
|
||||
[Tooltip("HP and mass configurations for each material type")]
|
||||
[SerializeField] private List<BlockMaterialConfig> materialConfigs = new List<BlockMaterialConfig>
|
||||
{
|
||||
new BlockMaterialConfig { material = BlockMaterial.Cardboard, baseHp = 20f, baseMass = 0.5f },
|
||||
new BlockMaterialConfig { material = BlockMaterial.Metal, baseHp = 50f, baseMass = 2f },
|
||||
new BlockMaterialConfig { material = BlockMaterial.Glass, baseHp = 15f, baseMass = 0.8f }
|
||||
};
|
||||
|
||||
[Header("Block Size Configurations")]
|
||||
[Tooltip("HP and mass multipliers for each size type")]
|
||||
[SerializeField] private List<BlockSizeConfig> sizeConfigs = new List<BlockSizeConfig>
|
||||
{
|
||||
new BlockSizeConfig { size = BlockSize.Small, hpMultiplier = 1f, massMultiplier = 0.5f },
|
||||
new BlockSizeConfig { size = BlockSize.Medium, hpMultiplier = 1.5f, massMultiplier = 1f },
|
||||
new BlockSizeConfig { size = BlockSize.Large, hpMultiplier = 2f, massMultiplier = 2f }
|
||||
};
|
||||
|
||||
[Header("AI Difficulty Configurations")]
|
||||
[Tooltip("AI behavior parameters for each difficulty level")]
|
||||
[SerializeField] private List<AIDifficultyConfig> aiDifficultyConfigs = new List<AIDifficultyConfig>
|
||||
{
|
||||
new AIDifficultyConfig { difficulty = AIDifficulty.Easy, data = new AIDifficultyData(45f, 0.3f, 0.5f, 2f) }, // ±45° angle, ±30% force, 0.5-2s think time
|
||||
new AIDifficultyConfig { difficulty = AIDifficulty.Medium, data = new AIDifficultyData(30f, 0.2f, 0.5f, 2f) }, // ±30° angle, ±20% force, 0.5-2s think time
|
||||
new AIDifficultyConfig { difficulty = AIDifficulty.Hard, data = new AIDifficultyData(10f, 0.1f, 0.5f, 2f) } // ±10° angle, ±10% force, 0.5-2s think time
|
||||
};
|
||||
|
||||
[Tooltip("Default AI difficulty level for single-player games")]
|
||||
[SerializeField] private AIDifficulty defaultAIDifficulty = AIDifficulty.Medium;
|
||||
|
||||
[Header("Weak Point Settings")]
|
||||
[Tooltip("Radius of explosion effect from weak points")]
|
||||
[SerializeField] private float weakPointExplosionRadius = 2.5f;
|
||||
|
||||
[Tooltip("Base damage dealt by weak point explosion")]
|
||||
[SerializeField] private float weakPointExplosionDamage = 50f;
|
||||
|
||||
[Tooltip("Force applied to blocks hit by weak point explosion")]
|
||||
[SerializeField] private float weakPointExplosionForce = 300f;
|
||||
|
||||
[Header("Fort Configuration")]
|
||||
[Tooltip("HP percentage threshold for fort defeat (0.3 = 30%)")]
|
||||
[SerializeField] private float fortDefeatThreshold = 0.3f;
|
||||
|
||||
[Header("Physics Settings")]
|
||||
[Tooltip("Gravity scale for fort blocks (1.0 = normal Unity gravity)")]
|
||||
[SerializeField] private float blockGravityScale = 1f;
|
||||
|
||||
[Tooltip("Gravity scale for projectiles (1.0 = normal Unity gravity)")]
|
||||
[SerializeField] private float projectileGravityScale = 1f;
|
||||
|
||||
[Header("Turn & Projectile Timing")]
|
||||
[Tooltip("Time to wait after projectile stops moving before ending turn")]
|
||||
[SerializeField] private float projectileSettleDelay = 2.5f;
|
||||
|
||||
[Tooltip("Additional delay during turn transition with wide view camera")]
|
||||
[SerializeField] private float turnTransitionDelay = 1.5f;
|
||||
|
||||
[Header("BASE Projectile Configurations")]
|
||||
[Tooltip("All available projectile types and their base configurations (damage, mass, cooldown)")]
|
||||
[SerializeField] private List<ProjectileConfig> projectileConfigs = new List<ProjectileConfig>();
|
||||
|
||||
[Header("Projectile Ability - Vacuum Cleaner")]
|
||||
[Tooltip("Constant sliding velocity in meters per second")]
|
||||
[SerializeField] private float vacuumSlideSpeed = 10f;
|
||||
|
||||
[Tooltip("Number of blocks to destroy while sliding")]
|
||||
[SerializeField] private int vacuumDestroyBlockCount = 3;
|
||||
|
||||
[Tooltip("Damage dealt to blocks while sliding (high value for instant destruction)")]
|
||||
[SerializeField] private float vacuumBlockDamage = 999f;
|
||||
|
||||
[Header("Projectile Ability - Trash Bag")]
|
||||
[Tooltip("Number of trash pieces to spawn on impact")]
|
||||
[SerializeField] private int trashBagPieceCount = 8;
|
||||
|
||||
[Tooltip("Force applied to each trash piece")]
|
||||
[SerializeField] private float trashBagPieceForce = 10f;
|
||||
|
||||
[Tooltip("Spread cone angle for trash pieces (degrees)")]
|
||||
[SerializeField] private float trashBagSpreadAngle = 60f;
|
||||
|
||||
[Tooltip("Damage each trash piece deals on collision with blocks")]
|
||||
[SerializeField] private float trashPieceDamage = 5f;
|
||||
|
||||
[Tooltip("How long trash pieces persist before auto-cleanup (seconds)")]
|
||||
[SerializeField] private float trashPieceLifetime = 5f;
|
||||
|
||||
[Header("Projectile Ability - Ceiling Fan")]
|
||||
[Tooltip("Delay before tap-to-drop becomes available (seconds)")]
|
||||
[SerializeField] private float ceilingFanActivationDelay = 0.5f;
|
||||
|
||||
[Tooltip("Brief pause before ceiling fan starts dropping (seconds)")]
|
||||
[SerializeField] private float ceilingFanDropDelay = 0.2f;
|
||||
|
||||
[Tooltip("Downward velocity when dropping (m/s)")]
|
||||
[SerializeField] private float ceilingFanDropSpeed = 20f;
|
||||
|
||||
[Header("Slingshot Settings")]
|
||||
[Tooltip("Base launch force multiplier - higher values = projectiles fly farther")]
|
||||
[SerializeField] private float baseLaunchForce = 20f;
|
||||
|
||||
[Tooltip("Minimum force multiplier (0-1, e.g. 0.1 = 10% of max force required to launch)")]
|
||||
[Range(0f, 1f)]
|
||||
[SerializeField] private float minForceMultiplier = 0.1f;
|
||||
|
||||
[Tooltip("Maximum force multiplier (0-1, e.g. 1.0 = 100% at max drag distance)")]
|
||||
[Range(0f, 2f)]
|
||||
[SerializeField] private float maxForceMultiplier = 1f;
|
||||
|
||||
[Tooltip("How long to keep trajectory visible after launching (seconds)")]
|
||||
[SerializeField] private float trajectoryLockDuration = 2f;
|
||||
|
||||
[Header("Physics Layers")]
|
||||
[Tooltip("Layer for fort blocks - projectiles will collide with these (Default: Layer 8 'FortBlock')")]
|
||||
[AppleHills.Core.Settings.Layer]
|
||||
[SerializeField] private int fortBlockLayer = 8;
|
||||
|
||||
[Tooltip("Layer for projectiles - for filtering projectile-to-projectile collisions (Default: Layer 9 'Projectile')")]
|
||||
[AppleHills.Core.Settings.Layer]
|
||||
[SerializeField] private int projectileLayer = 9;
|
||||
|
||||
[Header("Visual Settings")]
|
||||
[Tooltip("Color tint applied to damaged blocks")]
|
||||
[SerializeField] private Color damageColorTint = new Color(0.5f, 0.5f, 0.5f);
|
||||
|
||||
#region IFortFightSettings Implementation
|
||||
|
||||
public List<BlockMaterialConfig> MaterialConfigs => materialConfigs;
|
||||
public List<BlockSizeConfig> SizeConfigs => sizeConfigs;
|
||||
|
||||
public AIDifficulty DefaultAIDifficulty => defaultAIDifficulty;
|
||||
|
||||
public float WeakPointExplosionRadius => weakPointExplosionRadius;
|
||||
public float WeakPointExplosionDamage => weakPointExplosionDamage;
|
||||
public float WeakPointExplosionForce => weakPointExplosionForce;
|
||||
|
||||
public float FortDefeatThreshold => fortDefeatThreshold;
|
||||
public float PhysicsGravityScale => blockGravityScale; // Kept for backwards compatibility
|
||||
public float BlockGravityScale => blockGravityScale;
|
||||
public float ProjectileGravityScale => projectileGravityScale;
|
||||
|
||||
public float ProjectileSettleDelay => projectileSettleDelay;
|
||||
public float TurnTransitionDelay => turnTransitionDelay;
|
||||
|
||||
public int FortBlockLayer => fortBlockLayer;
|
||||
public int ProjectileLayer => projectileLayer;
|
||||
|
||||
public Color DamageColorTint => damageColorTint;
|
||||
|
||||
public float BaseLaunchForce => baseLaunchForce;
|
||||
public float MinForceMultiplier => minForceMultiplier;
|
||||
public float MaxForceMultiplier => maxForceMultiplier;
|
||||
public float TrajectoryLockDuration => trajectoryLockDuration;
|
||||
|
||||
public float VacuumSlideSpeed => vacuumSlideSpeed;
|
||||
public int VacuumDestroyBlockCount => vacuumDestroyBlockCount;
|
||||
public float VacuumBlockDamage => vacuumBlockDamage;
|
||||
public int TrashBagPieceCount => trashBagPieceCount;
|
||||
public float TrashBagPieceForce => trashBagPieceForce;
|
||||
public float TrashBagSpreadAngle => trashBagSpreadAngle;
|
||||
public float TrashPieceDamage => trashPieceDamage;
|
||||
public float TrashPieceLifetime => trashPieceLifetime;
|
||||
public float CeilingFanActivationDelay => ceilingFanActivationDelay;
|
||||
public float CeilingFanDropDelay => ceilingFanDropDelay;
|
||||
public float CeilingFanDropSpeed => ceilingFanDropSpeed;
|
||||
|
||||
public IReadOnlyList<ProjectileConfig> ProjectileConfigs => projectileConfigs;
|
||||
|
||||
/// <summary>
|
||||
/// Get projectile configuration by type
|
||||
/// </summary>
|
||||
public ProjectileConfig GetProjectileConfig(ProjectileType type)
|
||||
{
|
||||
foreach (var config in projectileConfigs)
|
||||
{
|
||||
if (config.projectileType == type)
|
||||
{
|
||||
return config;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get projectile configuration by ID string
|
||||
/// </summary>
|
||||
public ProjectileConfig GetProjectileConfigById(string projectileId)
|
||||
{
|
||||
foreach (var config in projectileConfigs)
|
||||
{
|
||||
if (config.projectileId == projectileId)
|
||||
{
|
||||
return config;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BlockMaterialConfig GetMaterialConfig(BlockMaterial material)
|
||||
{
|
||||
return materialConfigs.FirstOrDefault(c => c.material == material);
|
||||
}
|
||||
|
||||
public BlockSizeConfig GetSizeConfig(BlockSize size)
|
||||
{
|
||||
return sizeConfigs.FirstOrDefault(c => c.size == size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get AI difficulty configuration data by difficulty level
|
||||
/// </summary>
|
||||
public AIDifficultyData GetAIDifficultyData(AIDifficulty difficulty)
|
||||
{
|
||||
var config = aiDifficultyConfigs.FirstOrDefault(c => c.difficulty == difficulty);
|
||||
if (config != null)
|
||||
{
|
||||
return config.data;
|
||||
}
|
||||
|
||||
// Fallback to Medium difficulty if not found
|
||||
Debug.LogWarning($"[FortFightSettings] AI difficulty data not found for {difficulty}, using Medium as fallback");
|
||||
var mediumConfig = aiDifficultyConfigs.FirstOrDefault(c => c.difficulty == AIDifficulty.Medium);
|
||||
return mediumConfig != null ? mediumConfig.data : new AIDifficultyData(30f, 0.2f, 0.5f, 2f);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Validation
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
// Validate projectile configs
|
||||
foreach (var config in projectileConfigs)
|
||||
{
|
||||
config?.Validate();
|
||||
}
|
||||
// Ensure defeat threshold is between 0 and 1
|
||||
fortDefeatThreshold = Mathf.Clamp01(fortDefeatThreshold);
|
||||
|
||||
// Ensure all materials are configured
|
||||
foreach (BlockMaterial material in System.Enum.GetValues(typeof(BlockMaterial)))
|
||||
{
|
||||
if (!materialConfigs.Any(c => c.material == material))
|
||||
{
|
||||
Debug.LogWarning($"[FortFightSettings] Missing configuration for material: {material}");
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure all sizes are configured
|
||||
foreach (BlockSize size in System.Enum.GetValues(typeof(BlockSize)))
|
||||
{
|
||||
if (!sizeConfigs.Any(c => c.size == size))
|
||||
{
|
||||
Debug.LogWarning($"[FortFightSettings] Missing configuration for size: {size}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eaaa527529c5438f80d27ff95c7c7930
|
||||
timeCreated: 1764669847
|
||||
311
Assets/Scripts/Minigames/FortFight/Core/FortManager.cs
Normal file
311
Assets/Scripts/Minigames/FortFight/Core/FortManager.cs
Normal file
@@ -0,0 +1,311 @@
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.Fort;
|
||||
|
||||
namespace Minigames.FortFight.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages fort prefab spawning and references during gameplay.
|
||||
/// Singleton pattern for easy access to fort references.
|
||||
/// </summary>
|
||||
public class FortManager : ManagedBehaviour
|
||||
{
|
||||
#region Singleton
|
||||
|
||||
private static FortManager _instance;
|
||||
public static FortManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = FindFirstObjectByType<FortManager>();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Inspector Properties
|
||||
|
||||
[Header("Fort Prefabs")]
|
||||
[SerializeField] private GameObject[] premadeFortPrefabs;
|
||||
|
||||
[Header("Spawn Points")]
|
||||
[SerializeField] private Transform playerSpawnPoint;
|
||||
[SerializeField] private Transform enemySpawnPoint;
|
||||
|
||||
[Header("Settings")]
|
||||
[SerializeField] private bool useDebugForts = false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Developer Settings
|
||||
|
||||
private AppleHills.Core.Settings.FortFightDeveloperSettings _cachedDevSettings;
|
||||
private AppleHills.Core.Settings.FortFightDeveloperSettings CachedDevSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedDevSettings == null)
|
||||
{
|
||||
_cachedDevSettings = GameManager.GetDeveloperSettings<AppleHills.Core.Settings.FortFightDeveloperSettings>();
|
||||
}
|
||||
return _cachedDevSettings;
|
||||
}
|
||||
}
|
||||
|
||||
private GameObject DebugPlayerFortPrefab => CachedDevSettings?.DebugPlayerFortPrefab;
|
||||
private GameObject DebugEnemyFortPrefab => CachedDevSettings?.DebugEnemyFortPrefab;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Fired when player fort is spawned
|
||||
/// </summary>
|
||||
public event Action<FortController> OnPlayerFortSpawned;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when enemy fort is spawned
|
||||
/// </summary>
|
||||
public event Action<FortController> OnEnemyFortSpawned;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public FortController PlayerFort { get; private set; }
|
||||
public FortController EnemyFort { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Lifecycle
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
|
||||
// Register singleton
|
||||
if (_instance != null && _instance != this)
|
||||
{
|
||||
Logging.Warning("[FortManager] Multiple instances detected! Destroying duplicate.");
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
_instance = this;
|
||||
|
||||
// Validate spawn points
|
||||
if (playerSpawnPoint == null)
|
||||
{
|
||||
Logging.Error("[FortManager] Player spawn point not assigned!");
|
||||
}
|
||||
|
||||
if (enemySpawnPoint == null)
|
||||
{
|
||||
Logging.Error("[FortManager] Enemy spawn point not assigned!");
|
||||
}
|
||||
|
||||
// Validate fort prefabs
|
||||
if (premadeFortPrefabs == null || premadeFortPrefabs.Length == 0)
|
||||
{
|
||||
Logging.Warning("[FortManager] No premade fort prefabs assigned! Add at least one fort prefab.");
|
||||
}
|
||||
}
|
||||
|
||||
internal override void OnManagedDestroy()
|
||||
{
|
||||
base.OnManagedDestroy();
|
||||
|
||||
OnPlayerFortSpawned = null;
|
||||
OnEnemyFortSpawned = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Spawning
|
||||
|
||||
/// <summary>
|
||||
/// Spawn forts for both player and enemy at game start
|
||||
/// </summary>
|
||||
public void SpawnForts()
|
||||
{
|
||||
Logging.Debug("[FortManager] Spawning forts for both players");
|
||||
|
||||
// Spawn player fort
|
||||
if (useDebugForts && DebugPlayerFortPrefab != null)
|
||||
{
|
||||
PlayerFort = SpawnFort(DebugPlayerFortPrefab, playerSpawnPoint, "Player Fort");
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerFort = SpawnRandomFort(playerSpawnPoint, "Player Fort");
|
||||
}
|
||||
|
||||
if (PlayerFort != null)
|
||||
{
|
||||
OnPlayerFortSpawned?.Invoke(PlayerFort);
|
||||
}
|
||||
|
||||
// Spawn enemy fort
|
||||
if (useDebugForts && DebugEnemyFortPrefab != null)
|
||||
{
|
||||
EnemyFort = SpawnFort(DebugEnemyFortPrefab, enemySpawnPoint, "Enemy Fort");
|
||||
}
|
||||
else
|
||||
{
|
||||
EnemyFort = SpawnRandomFort(enemySpawnPoint, "Enemy Fort");
|
||||
}
|
||||
|
||||
if (EnemyFort != null)
|
||||
{
|
||||
OnEnemyFortSpawned?.Invoke(EnemyFort);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spawn a random fort from the premade prefabs array
|
||||
/// </summary>
|
||||
public FortController SpawnRandomFort(Transform spawnPoint, string overrideName = null)
|
||||
{
|
||||
if (premadeFortPrefabs == null || premadeFortPrefabs.Length == 0)
|
||||
{
|
||||
Logging.Error("[FortManager] Cannot spawn random fort - no prefabs available!");
|
||||
return null;
|
||||
}
|
||||
|
||||
GameObject randomPrefab = premadeFortPrefabs[UnityEngine.Random.Range(0, premadeFortPrefabs.Length)];
|
||||
return SpawnFort(randomPrefab, spawnPoint, overrideName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spawn a specific fort prefab
|
||||
/// </summary>
|
||||
public FortController SpawnFort(GameObject fortPrefab, Transform spawnPoint, string overrideName = null)
|
||||
{
|
||||
if (fortPrefab == null)
|
||||
{
|
||||
Logging.Error("[FortManager] Cannot spawn fort - prefab is null!");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (spawnPoint == null)
|
||||
{
|
||||
Logging.Error("[FortManager] Cannot spawn fort - spawn point is null!");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Instantiate fort
|
||||
GameObject fortInstance = Instantiate(fortPrefab, spawnPoint.position, Quaternion.identity, spawnPoint);
|
||||
fortInstance.name = overrideName ?? fortPrefab.name;
|
||||
|
||||
// Get FortController
|
||||
FortController controller = fortInstance.GetComponent<FortController>();
|
||||
if (controller == null)
|
||||
{
|
||||
Logging.Error($"[FortManager] Fort prefab {fortPrefab.name} is missing FortController component!");
|
||||
Destroy(fortInstance);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fort will self-initialize in Start() and register with this manager
|
||||
Logging.Debug($"[FortManager] Spawned fort: {controller.FortName} at {spawnPoint.name} (will self-initialize)");
|
||||
|
||||
return controller;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Fort Registration
|
||||
|
||||
/// <summary>
|
||||
/// Called by FortController when it finishes initialization.
|
||||
/// Determines if player/enemy fort and fires appropriate events.
|
||||
/// </summary>
|
||||
public void RegisterFort(FortController fort)
|
||||
{
|
||||
if (fort == null)
|
||||
{
|
||||
Logging.Error("[FortManager] Cannot register null fort!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine if this is player or enemy fort by checking which spawn point it's under
|
||||
bool isPlayerFort = fort.transform.IsChildOf(playerSpawnPoint);
|
||||
bool isEnemyFort = fort.transform.IsChildOf(enemySpawnPoint);
|
||||
|
||||
if (isPlayerFort)
|
||||
{
|
||||
PlayerFort = fort;
|
||||
Logging.Debug($"[FortManager] Registered PLAYER fort: {fort.FortName}");
|
||||
OnPlayerFortSpawned?.Invoke(fort);
|
||||
}
|
||||
else if (isEnemyFort)
|
||||
{
|
||||
EnemyFort = fort;
|
||||
Logging.Debug($"[FortManager] Registered ENEMY fort: {fort.FortName}");
|
||||
OnEnemyFortSpawned?.Invoke(fort);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Warning($"[FortManager] Fort {fort.FortName} is not under player or enemy spawn point! Cannot determine fort type.");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cleanup
|
||||
|
||||
/// <summary>
|
||||
/// Destroy all spawned forts (for game restart)
|
||||
/// </summary>
|
||||
public void ClearForts()
|
||||
{
|
||||
Logging.Debug("[FortManager] Clearing all forts");
|
||||
|
||||
if (PlayerFort != null)
|
||||
{
|
||||
Destroy(PlayerFort.gameObject);
|
||||
PlayerFort = null;
|
||||
}
|
||||
|
||||
if (EnemyFort != null)
|
||||
{
|
||||
Destroy(EnemyFort.gameObject);
|
||||
EnemyFort = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Queries
|
||||
|
||||
/// <summary>
|
||||
/// Get fort for a specific player
|
||||
/// </summary>
|
||||
public FortController GetFortForPlayer(PlayerData player)
|
||||
{
|
||||
if (player == null) return null;
|
||||
|
||||
return player.PlayerIndex == 0 ? PlayerFort : EnemyFort;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get opponent's fort
|
||||
/// </summary>
|
||||
public FortController GetOpponentFort(PlayerData player)
|
||||
{
|
||||
if (player == null) return null;
|
||||
|
||||
return player.PlayerIndex == 0 ? EnemyFort : PlayerFort;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47c585eb15414e8f802a6e31cbc6f501
|
||||
timeCreated: 1764592116
|
||||
166
Assets/Scripts/Minigames/FortFight/Core/ProjectileTurnAction.cs
Normal file
166
Assets/Scripts/Minigames/FortFight/Core/ProjectileTurnAction.cs
Normal file
@@ -0,0 +1,166 @@
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.Projectiles;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Turn action for projectile launching.
|
||||
/// Enables slingshot, waits for player to launch, waits for projectile to complete.
|
||||
/// </summary>
|
||||
public class ProjectileTurnAction
|
||||
{
|
||||
private SlingshotController slingshot;
|
||||
private AmmunitionManager ammoManager;
|
||||
private CameraController cameraController;
|
||||
private int playerIndex;
|
||||
private ProjectileBase activeProjectile;
|
||||
private bool launchComplete = false;
|
||||
private bool projectileSettled = false;
|
||||
private float settleTimer = 0f;
|
||||
|
||||
private IFortFightSettings _cachedSettings;
|
||||
private IFortFightSettings CachedSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedSettings == null)
|
||||
{
|
||||
_cachedSettings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
}
|
||||
return _cachedSettings;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsComplete => projectileSettled;
|
||||
|
||||
public ProjectileTurnAction(SlingshotController slingshot, AmmunitionManager ammoManager, CameraController cameraController, int playerIndex)
|
||||
{
|
||||
this.slingshot = slingshot;
|
||||
this.ammoManager = ammoManager;
|
||||
this.cameraController = cameraController;
|
||||
this.playerIndex = playerIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Execute the turn action - enable slingshot and wait for launch
|
||||
/// </summary>
|
||||
public void Execute()
|
||||
{
|
||||
Logging.Debug("[ProjectileTurnAction] Executing - enabling slingshot");
|
||||
|
||||
// Enable slingshot
|
||||
if (slingshot != null)
|
||||
{
|
||||
slingshot.Enable();
|
||||
|
||||
// Subscribe to launch event
|
||||
slingshot.OnProjectileLaunched += HandleProjectileLaunched;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the action (check if projectile has settled)
|
||||
/// </summary>
|
||||
public void Update()
|
||||
{
|
||||
if (!launchComplete) return;
|
||||
|
||||
// Check if projectile is destroyed or stopped
|
||||
if (activeProjectile == null)
|
||||
{
|
||||
// Projectile destroyed - start settle timer
|
||||
if (settleTimer == 0f)
|
||||
{
|
||||
Logging.Debug("[ProjectileTurnAction] Projectile destroyed - starting settle timer");
|
||||
}
|
||||
|
||||
settleTimer += Time.deltaTime;
|
||||
|
||||
float settleDelay = CachedSettings?.ProjectileSettleDelay ?? 2.5f;
|
||||
if (settleTimer >= settleDelay)
|
||||
{
|
||||
projectileSettled = true;
|
||||
|
||||
// Stop camera tracking when projectile settles
|
||||
if (cameraController != null)
|
||||
{
|
||||
cameraController.StopFollowingProjectile();
|
||||
}
|
||||
|
||||
Logging.Debug("[ProjectileTurnAction] Turn action complete");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if projectile has stopped moving
|
||||
Rigidbody2D rb = activeProjectile.GetComponent<Rigidbody2D>();
|
||||
if (rb != null && rb.linearVelocity.magnitude < 0.5f)
|
||||
{
|
||||
settleTimer += Time.deltaTime;
|
||||
|
||||
float settleDelay = CachedSettings?.ProjectileSettleDelay ?? 2.5f;
|
||||
if (settleTimer >= settleDelay)
|
||||
{
|
||||
projectileSettled = true;
|
||||
|
||||
// Stop camera tracking when projectile settles
|
||||
if (cameraController != null)
|
||||
{
|
||||
cameraController.StopFollowingProjectile();
|
||||
}
|
||||
|
||||
Logging.Debug("[ProjectileTurnAction] Projectile settled - turn action complete");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reset settle timer if still moving
|
||||
settleTimer = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cancel the action (disable slingshot)
|
||||
/// </summary>
|
||||
public void Cancel()
|
||||
{
|
||||
if (slingshot != null)
|
||||
{
|
||||
slingshot.Disable();
|
||||
slingshot.OnProjectileLaunched -= HandleProjectileLaunched;
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleProjectileLaunched(ProjectileBase projectile)
|
||||
{
|
||||
Logging.Debug($"[ProjectileTurnAction] Projectile launched: {projectile.gameObject.name}");
|
||||
|
||||
launchComplete = true;
|
||||
activeProjectile = projectile;
|
||||
|
||||
// Disable slingshot after launch
|
||||
if (slingshot != null)
|
||||
{
|
||||
slingshot.Disable();
|
||||
}
|
||||
|
||||
// Trigger cooldown for used ammo for this player
|
||||
if (ammoManager != null)
|
||||
{
|
||||
ProjectileType usedAmmoType = ammoManager.GetSelectedAmmoType(playerIndex);
|
||||
ammoManager.UseAmmo(usedAmmoType, playerIndex);
|
||||
}
|
||||
|
||||
// Start camera tracking the projectile
|
||||
if (cameraController != null && projectile != null)
|
||||
{
|
||||
cameraController.StartFollowingProjectile(projectile.transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac54e08365f94dbd91d2bace2b5964a6
|
||||
timeCreated: 1764682659
|
||||
374
Assets/Scripts/Minigames/FortFight/Core/SlingshotController.cs
Normal file
374
Assets/Scripts/Minigames/FortFight/Core/SlingshotController.cs
Normal file
@@ -0,0 +1,374 @@
|
||||
using System;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.Projectiles;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Controls slingshot aiming and projectile launching.
|
||||
/// Angry Birds-style drag-to-aim mechanic with trajectory preview.
|
||||
/// Implements ITouchInputConsumer for InputManager integration.
|
||||
/// </summary>
|
||||
public class SlingshotController : ManagedBehaviour, ITouchInputConsumer
|
||||
{
|
||||
#region Inspector Properties
|
||||
|
||||
[Header("Launch Settings")]
|
||||
[Tooltip("Drag distance to reach max force")]
|
||||
[SerializeField] private float maxDragDistance = 5f;
|
||||
|
||||
[Tooltip("Spawn point for projectiles")]
|
||||
[SerializeField] private Transform projectileSpawnPoint;
|
||||
|
||||
[Header("References")]
|
||||
[Tooltip("Trajectory preview component")]
|
||||
[SerializeField] private TrajectoryPreview trajectoryPreview;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Settings
|
||||
|
||||
private IFortFightSettings _cachedSettings;
|
||||
private IFortFightSettings CachedSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedSettings == null)
|
||||
{
|
||||
_cachedSettings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
}
|
||||
return _cachedSettings;
|
||||
}
|
||||
}
|
||||
|
||||
private FortFightDeveloperSettings _cachedDevSettings;
|
||||
private FortFightDeveloperSettings CachedDevSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedDevSettings == null)
|
||||
{
|
||||
_cachedDevSettings = GameManager.GetDeveloperSettings<FortFightDeveloperSettings>();
|
||||
}
|
||||
return _cachedDevSettings;
|
||||
}
|
||||
}
|
||||
|
||||
private float MaxForce => CachedSettings?.BaseLaunchForce ?? 20f;
|
||||
private bool ShowDebugLogs => CachedDevSettings?.SlingshotShowDebugLogs ?? false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Fired when projectile is launched. Parameters: (ProjectileBase projectile)
|
||||
/// </summary>
|
||||
public event Action<ProjectileBase> OnProjectileLaunched;
|
||||
|
||||
#endregion
|
||||
|
||||
#region State
|
||||
|
||||
private bool _isDragging;
|
||||
private Vector2 _dragStartPosition;
|
||||
private ProjectileConfig _currentAmmo;
|
||||
private ProjectileBase _activeProjectile;
|
||||
|
||||
public bool IsDragging => _isDragging;
|
||||
public bool IsEnabled { get; private set; } = true;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Lifecycle
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
|
||||
if (projectileSpawnPoint == null)
|
||||
{
|
||||
projectileSpawnPoint = transform;
|
||||
}
|
||||
|
||||
if (trajectoryPreview == null)
|
||||
{
|
||||
trajectoryPreview = GetComponent<TrajectoryPreview>();
|
||||
}
|
||||
}
|
||||
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedStart();
|
||||
|
||||
// Hide trajectory by default
|
||||
if (trajectoryPreview != null)
|
||||
{
|
||||
trajectoryPreview.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ITouchInputConsumer Implementation
|
||||
|
||||
public void OnTap(Vector2 worldPosition)
|
||||
{
|
||||
// Slingshot uses hold/drag, not tap
|
||||
}
|
||||
|
||||
public void OnHoldStart(Vector2 worldPosition)
|
||||
{
|
||||
if (!IsEnabled) return;
|
||||
StartDrag(worldPosition);
|
||||
}
|
||||
|
||||
public void OnHoldMove(Vector2 worldPosition)
|
||||
{
|
||||
if (!IsEnabled || !_isDragging) return;
|
||||
UpdateDrag(worldPosition);
|
||||
}
|
||||
|
||||
public void OnHoldEnd(Vector2 worldPosition)
|
||||
{
|
||||
if (!IsEnabled || !_isDragging) return;
|
||||
EndDrag(worldPosition);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Drag Handling
|
||||
|
||||
private void StartDrag(Vector2 worldPosition)
|
||||
{
|
||||
if (_currentAmmo == null)
|
||||
{
|
||||
if (ShowDebugLogs) Logging.Warning("[SlingshotController] No ammo selected!");
|
||||
return;
|
||||
}
|
||||
|
||||
_isDragging = true;
|
||||
// Use the projectile spawn point as the anchor, not the touch position
|
||||
// This makes it work like Angry Birds - pull back from slingshot to launch forward
|
||||
_dragStartPosition = projectileSpawnPoint.position;
|
||||
|
||||
// Show trajectory preview
|
||||
if (trajectoryPreview != null)
|
||||
{
|
||||
trajectoryPreview.Show();
|
||||
}
|
||||
|
||||
if (ShowDebugLogs) Logging.Debug($"[SlingshotController] Started drag at {worldPosition}, anchor at spawn point {_dragStartPosition}");
|
||||
}
|
||||
|
||||
private void UpdateDrag(Vector2 currentWorldPosition)
|
||||
{
|
||||
// Calculate drag vector from spawn point to current drag position
|
||||
// Pull back (away from spawn) = launch forward (toward spawn direction)
|
||||
Vector2 dragVector = _dragStartPosition - currentWorldPosition;
|
||||
|
||||
// Calculate force and direction
|
||||
float dragDistance = dragVector.magnitude;
|
||||
float dragRatio = Mathf.Clamp01(dragDistance / maxDragDistance);
|
||||
|
||||
// Apply configurable max force multiplier
|
||||
float maxMultiplier = CachedSettings?.MaxForceMultiplier ?? 1f;
|
||||
float forceMultiplier = dragRatio * maxMultiplier;
|
||||
float force = forceMultiplier * MaxForce;
|
||||
|
||||
Vector2 direction = dragVector.normalized;
|
||||
|
||||
// Update trajectory preview with projectile mass
|
||||
if (trajectoryPreview != null && _currentAmmo != null)
|
||||
{
|
||||
Vector2 worldStartPos = projectileSpawnPoint.position;
|
||||
float mass = _currentAmmo.GetMass();
|
||||
|
||||
// Debug: Log trajectory calculation (uncomment for debugging)
|
||||
// if (showDebugLogs && Time.frameCount % 30 == 0) // Log every 30 frames to avoid spam
|
||||
// {
|
||||
// Logging.Debug($"[Slingshot] Preview - Force: {force:F2}, Mass: {mass:F2}, Velocity: {force/mass:F2}, Dir: {direction}");
|
||||
// }
|
||||
|
||||
trajectoryPreview.UpdateTrajectory(worldStartPos, direction, force, mass);
|
||||
}
|
||||
}
|
||||
|
||||
private void EndDrag(Vector2 currentWorldPosition)
|
||||
{
|
||||
_isDragging = false;
|
||||
|
||||
// Hide trajectory
|
||||
if (trajectoryPreview != null)
|
||||
{
|
||||
trajectoryPreview.Hide();
|
||||
}
|
||||
|
||||
// Calculate final launch parameters from spawn point to final drag position
|
||||
Vector2 dragVector = _dragStartPosition - currentWorldPosition;
|
||||
float dragDistance = dragVector.magnitude;
|
||||
float dragRatio = Mathf.Clamp01(dragDistance / maxDragDistance);
|
||||
|
||||
// Apply configurable max force multiplier
|
||||
float maxMultiplier = CachedSettings?.MaxForceMultiplier ?? 1f;
|
||||
float forceMultiplier = dragRatio * maxMultiplier;
|
||||
float force = forceMultiplier * MaxForce;
|
||||
|
||||
Vector2 direction = dragVector.normalized;
|
||||
|
||||
// Check against configurable minimum force threshold
|
||||
float minMultiplier = CachedSettings?.MinForceMultiplier ?? 0.1f;
|
||||
float minForce = minMultiplier * MaxForce;
|
||||
|
||||
// Launch projectile if force exceeds minimum
|
||||
if (force >= minForce)
|
||||
{
|
||||
if (ShowDebugLogs && _currentAmmo != null)
|
||||
{
|
||||
float mass = _currentAmmo.GetMass();
|
||||
float velocity = force / mass;
|
||||
Logging.Debug($"[Slingshot] Launch - Force: {force:F2}, Mass: {mass:F2}, Velocity: {velocity:F2}, Dir: {direction}");
|
||||
}
|
||||
|
||||
LaunchProjectile(direction, force);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ShowDebugLogs) Logging.Debug($"[SlingshotController] Drag too short - force {force:F2} < min {minForce:F2}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Projectile Management
|
||||
|
||||
/// <summary>
|
||||
/// Set the current ammunition type
|
||||
/// </summary>
|
||||
public void SetAmmo(ProjectileConfig ammoConfig)
|
||||
{
|
||||
_currentAmmo = ammoConfig;
|
||||
if (ShowDebugLogs) Logging.Debug($"[SlingshotController] Ammo set to: {ammoConfig?.displayName ?? "null"}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Launch a projectile with calculated force and direction
|
||||
/// </summary>
|
||||
private void LaunchProjectile(Vector2 direction, float force)
|
||||
{
|
||||
if (_currentAmmo == null || _currentAmmo.prefab == null)
|
||||
{
|
||||
Logging.Error("[SlingshotController] Cannot launch - no ammo or prefab!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Spawn projectile
|
||||
GameObject projectileObj = Instantiate(_currentAmmo.prefab, projectileSpawnPoint.position, Quaternion.identity);
|
||||
_activeProjectile = projectileObj.GetComponent<ProjectileBase>();
|
||||
|
||||
if (_activeProjectile == null)
|
||||
{
|
||||
Logging.Error($"[SlingshotController] Projectile prefab {_currentAmmo.prefab.name} missing ProjectileBase component!");
|
||||
Destroy(projectileObj);
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize projectile with its type (loads damage and mass from settings)
|
||||
_activeProjectile.Initialize(_currentAmmo.projectileType);
|
||||
|
||||
// Launch it
|
||||
_activeProjectile.Launch(direction, force);
|
||||
|
||||
// Lock trajectory to show the shot path
|
||||
if (trajectoryPreview != null)
|
||||
{
|
||||
float lockDuration = CachedSettings?.TrajectoryLockDuration ?? 2f;
|
||||
trajectoryPreview.LockTrajectory(lockDuration);
|
||||
}
|
||||
|
||||
if (ShowDebugLogs) Logging.Debug($"[SlingshotController] Launched {_currentAmmo?.displayName ?? "projectile"} with force {force}");
|
||||
|
||||
// Fire event
|
||||
OnProjectileLaunched?.Invoke(_activeProjectile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Public method for AI to simulate a drag-and-launch action
|
||||
/// </summary>
|
||||
public void SimulateDragLaunch(Vector2 direction, float force)
|
||||
{
|
||||
LaunchProjectile(direction, force);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Launch projectile with a specific velocity (for AI ballistic calculations)
|
||||
/// Calculates the required force based on projectile mass
|
||||
/// </summary>
|
||||
public void LaunchWithVelocity(Vector2 velocity)
|
||||
{
|
||||
if (_currentAmmo == null)
|
||||
{
|
||||
Logging.Error("[SlingshotController] Cannot launch - no ammo selected!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get projectile mass to calculate force
|
||||
float mass = _currentAmmo.GetMass();
|
||||
|
||||
// Force = mass × velocity (for impulse-based launch)
|
||||
Vector2 direction = velocity.normalized;
|
||||
float speed = velocity.magnitude;
|
||||
float force = mass * speed;
|
||||
|
||||
if (ShowDebugLogs)
|
||||
{
|
||||
Logging.Debug($"[Slingshot] LaunchWithVelocity - Velocity: {velocity}, Mass: {mass:F2}, Force: {force:F2}");
|
||||
}
|
||||
|
||||
LaunchProjectile(direction, force);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get currently active projectile (in flight)
|
||||
/// </summary>
|
||||
public ProjectileBase GetActiveProjectile()
|
||||
{
|
||||
return _activeProjectile;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Enable/Disable
|
||||
|
||||
/// <summary>
|
||||
/// Enable slingshot (allow aiming/launching)
|
||||
/// </summary>
|
||||
public void Enable()
|
||||
{
|
||||
IsEnabled = true;
|
||||
if (ShowDebugLogs) Logging.Debug("[SlingshotController] Enabled");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disable slingshot (prevent aiming/launching)
|
||||
/// </summary>
|
||||
public void Disable()
|
||||
{
|
||||
IsEnabled = false;
|
||||
_isDragging = false;
|
||||
|
||||
if (trajectoryPreview != null)
|
||||
{
|
||||
trajectoryPreview.Hide();
|
||||
}
|
||||
|
||||
if (ShowDebugLogs) Logging.Debug("[SlingshotController] Disabled");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc81b72132764f09a0ba180c90b432cf
|
||||
timeCreated: 1764682598
|
||||
153
Assets/Scripts/Minigames/FortFight/Core/TrajectoryPreview.cs
Normal file
153
Assets/Scripts/Minigames/FortFight/Core/TrajectoryPreview.cs
Normal file
@@ -0,0 +1,153 @@
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Displays trajectory prediction line for projectile launches.
|
||||
/// Shows dotted line preview of projectile arc.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(LineRenderer))]
|
||||
public class TrajectoryPreview : MonoBehaviour
|
||||
{
|
||||
[Header("Trajectory Settings")]
|
||||
[Tooltip("Number of points to simulate (physics steps)")]
|
||||
[SerializeField] private int simulationSteps = 50;
|
||||
|
||||
[Header("Visual")]
|
||||
[Tooltip("Color of trajectory line")]
|
||||
[SerializeField] private Color lineColor = Color.yellow;
|
||||
|
||||
[Tooltip("Width of trajectory line")]
|
||||
[SerializeField] private float lineWidth = 0.1f;
|
||||
|
||||
private LineRenderer lineRenderer;
|
||||
private bool isLocked = false;
|
||||
private float lockTimer = 0f;
|
||||
private float lockDuration = 0f;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
lineRenderer = GetComponent<LineRenderer>();
|
||||
|
||||
// Configure line renderer
|
||||
if (lineRenderer != null)
|
||||
{
|
||||
lineRenderer.startWidth = lineWidth;
|
||||
lineRenderer.endWidth = lineWidth;
|
||||
lineRenderer.startColor = lineColor;
|
||||
lineRenderer.endColor = lineColor;
|
||||
lineRenderer.positionCount = simulationSteps;
|
||||
lineRenderer.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (isLocked)
|
||||
{
|
||||
lockTimer += Time.deltaTime;
|
||||
if (lockTimer >= lockDuration)
|
||||
{
|
||||
isLocked = false;
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show the trajectory preview
|
||||
/// </summary>
|
||||
public void Show()
|
||||
{
|
||||
if (lineRenderer != null)
|
||||
{
|
||||
lineRenderer.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hide the trajectory preview (unless locked)
|
||||
/// </summary>
|
||||
public void Hide()
|
||||
{
|
||||
// Don't hide if trajectory is locked
|
||||
if (isLocked)
|
||||
return;
|
||||
|
||||
if (lineRenderer != null)
|
||||
{
|
||||
lineRenderer.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lock the current trajectory display for a duration
|
||||
/// </summary>
|
||||
public void LockTrajectory(float duration)
|
||||
{
|
||||
isLocked = true;
|
||||
lockTimer = 0f;
|
||||
lockDuration = duration;
|
||||
|
||||
// Ensure line is visible
|
||||
if (lineRenderer != null)
|
||||
{
|
||||
lineRenderer.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the trajectory preview with new parameters.
|
||||
/// Uses Physics.fixedDeltaTime for accurate simulation matching Unity's physics.
|
||||
/// </summary>
|
||||
/// <param name="startPosition">Starting position of trajectory</param>
|
||||
/// <param name="direction">Launch direction (normalized)</param>
|
||||
/// <param name="force">Launch force (impulse)</param>
|
||||
/// <param name="mass">Projectile mass</param>
|
||||
public void UpdateTrajectory(Vector2 startPosition, Vector2 direction, float force, float mass = 1f)
|
||||
{
|
||||
if (lineRenderer == null) return;
|
||||
|
||||
// Calculate initial velocity: impulse force F gives velocity v = F/m
|
||||
Vector2 startVelocity = (direction * force) / mass;
|
||||
|
||||
// Get gravity with projectile gravity scale from settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
float gravityScale = settings?.ProjectileGravityScale ?? 1f;
|
||||
Vector2 gravity = new Vector2(Physics2D.gravity.x, Physics2D.gravity.y) * gravityScale;
|
||||
|
||||
// Simulate trajectory using Unity's physics time step
|
||||
Vector3[] points = new Vector3[simulationSteps];
|
||||
Vector2 pos = startPosition;
|
||||
Vector2 vel = startVelocity;
|
||||
|
||||
for (int i = 0; i < simulationSteps; i++)
|
||||
{
|
||||
// Set current position
|
||||
points[i] = new Vector3(pos.x, pos.y, 0);
|
||||
|
||||
// Update velocity (gravity applied over fixedDeltaTime)
|
||||
vel = vel + gravity * Time.fixedDeltaTime;
|
||||
|
||||
// Update position (velocity applied over fixedDeltaTime)
|
||||
pos = pos + vel * Time.fixedDeltaTime;
|
||||
|
||||
// Optional: Stop if hits ground (y < threshold)
|
||||
if (pos.y < -10f)
|
||||
{
|
||||
// Fill remaining points at ground level
|
||||
for (int j = i + 1; j < simulationSteps; j++)
|
||||
{
|
||||
points[j] = new Vector3(pos.x, -10f, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
lineRenderer.positionCount = simulationSteps;
|
||||
lineRenderer.SetPositions(points);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b1e26667c6d4415f8dc51e4a58ba9479
|
||||
timeCreated: 1764682615
|
||||
372
Assets/Scripts/Minigames/FortFight/Core/TurnManager.cs
Normal file
372
Assets/Scripts/Minigames/FortFight/Core/TurnManager.cs
Normal file
@@ -0,0 +1,372 @@
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Minigames.FortFight.Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages turn order and turn state for Fort Fight minigame.
|
||||
/// Handles transitions between Player One, Player Two/AI turns.
|
||||
/// Manages turn actions and input delegation.
|
||||
/// Singleton pattern for easy access to turn state.
|
||||
/// </summary>
|
||||
public class TurnManager : ManagedBehaviour
|
||||
{
|
||||
#region Singleton
|
||||
|
||||
private static TurnManager _instance;
|
||||
public static TurnManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = FindFirstObjectByType<TurnManager>();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Inspector References
|
||||
|
||||
[Header("Slingshot Controllers")]
|
||||
[Tooltip("Slingshot for Player One")]
|
||||
[SerializeField] private SlingshotController playerOneSlingshotController;
|
||||
|
||||
[Tooltip("Slingshot for Player Two")]
|
||||
[SerializeField] private SlingshotController playerTwoSlingshotController;
|
||||
|
||||
[Header("Systems")]
|
||||
[Tooltip("Camera controller for projectile tracking")]
|
||||
[SerializeField] private CameraController cameraController;
|
||||
|
||||
// Note: AmmunitionManager accessed via singleton (AmmunitionManager.Instance)
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Fired when a new turn begins. Parameters: (PlayerData currentPlayer, TurnState turnState)
|
||||
/// </summary>
|
||||
public event Action<PlayerData, TurnState> OnTurnStarted;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the current turn ends. Parameters: (PlayerData playerWhoFinished)
|
||||
/// </summary>
|
||||
public event Action<PlayerData> OnTurnEnded;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when transitioning between turns
|
||||
/// </summary>
|
||||
public event Action OnTurnTransitioning;
|
||||
|
||||
#endregion
|
||||
|
||||
#region State
|
||||
|
||||
private TurnState currentTurnState = TurnState.PlayerOneTurn;
|
||||
private PlayerData playerOne;
|
||||
private PlayerData playerTwo;
|
||||
private PlayerData currentPlayer;
|
||||
private int turnCount = 0;
|
||||
|
||||
// Turn action management
|
||||
private ProjectileTurnAction currentTurnAction;
|
||||
private bool isTransitioning = false;
|
||||
private float transitionTimer = 0f;
|
||||
|
||||
public TurnState CurrentTurnState => currentTurnState;
|
||||
public PlayerData CurrentPlayer => currentPlayer;
|
||||
public int TurnCount => turnCount;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Initialization
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
|
||||
// Register singleton
|
||||
if (_instance != null && _instance != this)
|
||||
{
|
||||
Logging.Warning("[TurnManager] Multiple instances detected! Destroying duplicate.");
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
_instance = this;
|
||||
|
||||
// Validate references
|
||||
if (playerOneSlingshotController == null)
|
||||
{
|
||||
Logging.Error("[TurnManager] Player One slingshot controller not assigned!");
|
||||
}
|
||||
|
||||
if (playerTwoSlingshotController == null)
|
||||
{
|
||||
Logging.Error("[TurnManager] Player Two slingshot controller not assigned!");
|
||||
}
|
||||
|
||||
if (cameraController == null)
|
||||
{
|
||||
Logging.Warning("[TurnManager] Camera controller not assigned - projectiles won't be followed by camera!");
|
||||
}
|
||||
|
||||
// Disable both slingshots initially
|
||||
if (playerOneSlingshotController != null) playerOneSlingshotController.Disable();
|
||||
if (playerTwoSlingshotController != null) playerTwoSlingshotController.Disable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the turn manager with player data
|
||||
/// </summary>
|
||||
public void Initialize(PlayerData pPlayerOne, PlayerData pPlayerTwo)
|
||||
{
|
||||
this.playerOne = pPlayerOne;
|
||||
this.playerTwo = pPlayerTwo;
|
||||
|
||||
Logging.Debug($"[TurnManager] Initialized with P1: {pPlayerOne.PlayerName} (AI: {pPlayerOne.IsAI}), P2: {pPlayerTwo.PlayerName} (AI: {pPlayerTwo.IsAI})");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start the first turn
|
||||
/// </summary>
|
||||
public void StartGame()
|
||||
{
|
||||
turnCount = 0;
|
||||
currentTurnState = TurnState.PlayerOneTurn;
|
||||
currentPlayer = playerOne;
|
||||
|
||||
// Set initial input mode to UI
|
||||
if (Input.InputManager.Instance != null)
|
||||
{
|
||||
Input.InputManager.Instance.SetInputMode(Input.InputMode.UI);
|
||||
}
|
||||
|
||||
Logging.Debug($"[TurnManager] Game started. First turn: {currentPlayer.PlayerName}");
|
||||
OnTurnStarted?.Invoke(currentPlayer, currentTurnState);
|
||||
|
||||
// Start turn action for first player
|
||||
StartTurnAction();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Lifecycle
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// Update current turn action
|
||||
if (currentTurnAction != null && !isTransitioning)
|
||||
{
|
||||
currentTurnAction.Update();
|
||||
|
||||
// Check if action is complete
|
||||
if (currentTurnAction.IsComplete)
|
||||
{
|
||||
EndTurnAction();
|
||||
}
|
||||
}
|
||||
|
||||
// Handle transition timing
|
||||
if (isTransitioning)
|
||||
{
|
||||
transitionTimer += Time.deltaTime;
|
||||
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
float transitionDelay = settings?.TurnTransitionDelay ?? 1.5f;
|
||||
|
||||
if (transitionTimer >= transitionDelay)
|
||||
{
|
||||
CompleteTransition();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Turn Management
|
||||
|
||||
/// <summary>
|
||||
/// Start turn action for current player (projectile launch)
|
||||
/// </summary>
|
||||
private void StartTurnAction()
|
||||
{
|
||||
// Get the appropriate slingshot for current player
|
||||
SlingshotController activeSlingshot = GetSlingshotForPlayer(currentPlayer);
|
||||
|
||||
if (activeSlingshot == null)
|
||||
{
|
||||
Logging.Error($"[TurnManager] No slingshot found for {currentPlayer.PlayerName}!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Create and execute turn action with player index
|
||||
currentTurnAction = new ProjectileTurnAction(activeSlingshot, AmmunitionManager.Instance, cameraController, currentPlayer.PlayerIndex);
|
||||
|
||||
// Set current ammo on slingshot for this player
|
||||
if (AmmunitionManager.Instance != null)
|
||||
{
|
||||
ProjectileConfig currentAmmo = AmmunitionManager.Instance.GetSelectedAmmoConfig(currentPlayer.PlayerIndex);
|
||||
if (currentAmmo != null)
|
||||
{
|
||||
activeSlingshot.SetAmmo(currentAmmo);
|
||||
}
|
||||
}
|
||||
|
||||
// Execute the action (enables slingshot)
|
||||
currentTurnAction.Execute();
|
||||
|
||||
// Register slingshot as input consumer and switch to Game mode
|
||||
if (Input.InputManager.Instance != null)
|
||||
{
|
||||
Input.InputManager.Instance.RegisterOverrideConsumer(activeSlingshot);
|
||||
Input.InputManager.Instance.SetInputMode(Input.InputMode.Game);
|
||||
}
|
||||
|
||||
Logging.Debug($"[TurnManager] Started turn action for {currentPlayer.PlayerName}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// End current turn action (projectile has settled)
|
||||
/// </summary>
|
||||
private void EndTurnAction()
|
||||
{
|
||||
Logging.Debug($"[TurnManager] Ending turn action for {currentPlayer.PlayerName}");
|
||||
|
||||
// Get active slingshot and unregister from input
|
||||
SlingshotController activeSlingshot = GetSlingshotForPlayer(currentPlayer);
|
||||
if (activeSlingshot != null && Input.InputManager.Instance != null)
|
||||
{
|
||||
Input.InputManager.Instance.UnregisterOverrideConsumer(activeSlingshot);
|
||||
}
|
||||
|
||||
// Restore UI input mode
|
||||
if (Input.InputManager.Instance != null)
|
||||
{
|
||||
Input.InputManager.Instance.SetInputMode(Input.InputMode.UI);
|
||||
}
|
||||
|
||||
// Clear turn action
|
||||
currentTurnAction = null;
|
||||
|
||||
// End the turn
|
||||
EndTurn();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// End the current turn and begin transition to next player
|
||||
/// </summary>
|
||||
private void EndTurn()
|
||||
{
|
||||
if (currentTurnState == TurnState.GameOver)
|
||||
{
|
||||
Logging.Warning("[TurnManager] Cannot end turn - game is over");
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.Debug($"[TurnManager] Turn ended for {currentPlayer.PlayerName}");
|
||||
OnTurnEnded?.Invoke(currentPlayer);
|
||||
|
||||
// Decrement ammunition cooldowns for this player
|
||||
if (AmmunitionManager.Instance != null)
|
||||
{
|
||||
AmmunitionManager.Instance.DecrementCooldowns(currentPlayer.PlayerIndex);
|
||||
}
|
||||
|
||||
// Enter transition state (triggers wide view camera via OnTurnStarted)
|
||||
currentTurnState = TurnState.TransitioningTurn;
|
||||
OnTurnTransitioning?.Invoke();
|
||||
OnTurnStarted?.Invoke(currentPlayer, currentTurnState); // Fire for camera switch to wide view
|
||||
|
||||
// Start transition timer
|
||||
isTransitioning = true;
|
||||
transitionTimer = 0f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Complete transition and advance to next player
|
||||
/// </summary>
|
||||
private void CompleteTransition()
|
||||
{
|
||||
isTransitioning = false;
|
||||
transitionTimer = 0f;
|
||||
|
||||
AdvanceToNextPlayer();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Advance to the next player's turn (called after transition delay)
|
||||
/// </summary>
|
||||
private void AdvanceToNextPlayer()
|
||||
{
|
||||
turnCount++;
|
||||
|
||||
// Switch players
|
||||
if (currentPlayer == playerOne)
|
||||
{
|
||||
currentPlayer = playerTwo;
|
||||
currentTurnState = playerTwo.IsAI ? TurnState.AITurn : TurnState.PlayerTwoTurn;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentPlayer = playerOne;
|
||||
currentTurnState = TurnState.PlayerOneTurn;
|
||||
}
|
||||
|
||||
Logging.Debug($"[TurnManager] Advanced to turn {turnCount}. Current player: {currentPlayer.PlayerName} (State: {currentTurnState})");
|
||||
OnTurnStarted?.Invoke(currentPlayer, currentTurnState);
|
||||
|
||||
// Start turn action for next player
|
||||
StartTurnAction();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the slingshot controller for a specific player
|
||||
/// </summary>
|
||||
private SlingshotController GetSlingshotForPlayer(PlayerData player)
|
||||
{
|
||||
if (player == playerOne)
|
||||
{
|
||||
return playerOneSlingshotController;
|
||||
}
|
||||
else if (player == playerTwo)
|
||||
{
|
||||
return playerTwoSlingshotController;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Force game over state
|
||||
/// </summary>
|
||||
public void SetGameOver()
|
||||
{
|
||||
currentTurnState = TurnState.GameOver;
|
||||
Logging.Debug("[TurnManager] Game over state set");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cleanup
|
||||
|
||||
internal override void OnManagedDestroy()
|
||||
{
|
||||
base.OnManagedDestroy();
|
||||
|
||||
// Clear all event listeners
|
||||
OnTurnStarted = null;
|
||||
OnTurnEnded = null;
|
||||
OnTurnTransitioning = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0b22cad084c0ba44b522474269c2c4b
|
||||
8
Assets/Scripts/Minigames/FortFight/Data.meta
Normal file
8
Assets/Scripts/Minigames/FortFight/Data.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08a9c8eba88cf1148bcf11e305a91051
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
51
Assets/Scripts/Minigames/FortFight/Data/AIDifficultyData.cs
Normal file
51
Assets/Scripts/Minigames/FortFight/Data/AIDifficultyData.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Configuration data for AI difficulty levels.
|
||||
/// Defines how accurate and fast the AI behaves at each difficulty tier.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct AIDifficultyData
|
||||
{
|
||||
[Tooltip("Angle deviation in degrees (±)")]
|
||||
public float angleDeviation;
|
||||
|
||||
[Tooltip("Force/speed deviation as percentage (0.2 = ±20%)")]
|
||||
public float forceDeviation;
|
||||
|
||||
[Tooltip("Minimum thinking time in seconds")]
|
||||
public float thinkTimeMin;
|
||||
|
||||
[Tooltip("Maximum thinking time in seconds")]
|
||||
public float thinkTimeMax;
|
||||
|
||||
/// <summary>
|
||||
/// Create AI difficulty data with specified parameters
|
||||
/// </summary>
|
||||
public AIDifficultyData(float angleDeviation, float forceDeviation, float thinkTimeMin, float thinkTimeMax)
|
||||
{
|
||||
this.angleDeviation = angleDeviation;
|
||||
this.forceDeviation = forceDeviation;
|
||||
this.thinkTimeMin = thinkTimeMin;
|
||||
this.thinkTimeMax = thinkTimeMax;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper class to serialize AI difficulty configuration in Unity inspector.
|
||||
/// Maps difficulty level to its configuration data.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class AIDifficultyConfig
|
||||
{
|
||||
[Tooltip("Difficulty level")]
|
||||
public AIDifficulty difficulty;
|
||||
|
||||
[Tooltip("Configuration data for this difficulty")]
|
||||
public AIDifficultyData data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9da4870f05ff4968a77b4e790efbb264
|
||||
timeCreated: 1764841304
|
||||
65
Assets/Scripts/Minigames/FortFight/Data/FortFightEnums.cs
Normal file
65
Assets/Scripts/Minigames/FortFight/Data/FortFightEnums.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
namespace Minigames.FortFight.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Game mode for Fort Fight minigame
|
||||
/// </summary>
|
||||
public enum FortFightGameMode
|
||||
{
|
||||
SinglePlayer, // Player vs AI
|
||||
TwoPlayer // Player vs Player
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current turn state in the game
|
||||
/// </summary>
|
||||
public enum TurnState
|
||||
{
|
||||
PlayerOneTurn,
|
||||
PlayerTwoTurn,
|
||||
AITurn,
|
||||
TransitioningTurn, // Transitioning between turns (projectile in flight, waiting for settle)
|
||||
GameOver
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Material types for fort blocks
|
||||
/// </summary>
|
||||
public enum BlockMaterial
|
||||
{
|
||||
Cardboard,
|
||||
Metal,
|
||||
Glass
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Size categories for fort blocks
|
||||
/// </summary>
|
||||
public enum BlockSize
|
||||
{
|
||||
Small,
|
||||
Medium,
|
||||
Large
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Types of projectiles available
|
||||
/// </summary>
|
||||
public enum ProjectileType
|
||||
{
|
||||
Toaster, // Standard physics projectile
|
||||
Vacuum, // Heavy, rolls on floor
|
||||
CeilingFan, // Drops straight down
|
||||
TrashBag // Explodes on impact
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AI difficulty levels with varying accuracy and behavior
|
||||
/// </summary>
|
||||
public enum AIDifficulty
|
||||
{
|
||||
Easy, // Large deviations, slower thinking
|
||||
Medium, // Moderate deviations, moderate thinking
|
||||
Hard // Minimal deviations, faster thinking
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9891698193c757344bc2f3f26730248a
|
||||
156
Assets/Scripts/Minigames/FortFight/Data/PlayerAmmoState.cs
Normal file
156
Assets/Scripts/Minigames/FortFight/Data/PlayerAmmoState.cs
Normal file
@@ -0,0 +1,156 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Minigames.FortFight.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Encapsulates all ammunition state for a single player.
|
||||
/// Tracks cooldowns, selection, and usage history per player.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class PlayerAmmoState
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public int PlayerIndex { get; private set; }
|
||||
public ProjectileType SelectedAmmo { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region State
|
||||
|
||||
// Cooldowns per projectile type (turns remaining)
|
||||
private Dictionary<ProjectileType, int> cooldowns;
|
||||
|
||||
// Optional: Track usage for statistics/analytics
|
||||
private Dictionary<ProjectileType, int> usageCount;
|
||||
private ProjectileType lastUsedProjectile;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public PlayerAmmoState(int playerIndex, ProjectileType defaultAmmo)
|
||||
{
|
||||
PlayerIndex = playerIndex;
|
||||
SelectedAmmo = defaultAmmo;
|
||||
cooldowns = new Dictionary<ProjectileType, int>();
|
||||
usageCount = new Dictionary<ProjectileType, int>();
|
||||
lastUsedProjectile = defaultAmmo;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cooldown Management
|
||||
|
||||
/// <summary>
|
||||
/// Initialize cooldown for a specific projectile type.
|
||||
/// </summary>
|
||||
public void InitializeCooldown(ProjectileType type)
|
||||
{
|
||||
if (!cooldowns.ContainsKey(type))
|
||||
{
|
||||
cooldowns[type] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set cooldown for a specific projectile type.
|
||||
/// </summary>
|
||||
public void SetCooldown(ProjectileType type, int turns)
|
||||
{
|
||||
cooldowns[type] = turns;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get remaining cooldown turns for a projectile type.
|
||||
/// </summary>
|
||||
public int GetCooldown(ProjectileType type)
|
||||
{
|
||||
return cooldowns.ContainsKey(type) ? cooldowns[type] : 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if projectile type is available (not on cooldown).
|
||||
/// </summary>
|
||||
public bool IsAmmoAvailable(ProjectileType type)
|
||||
{
|
||||
return GetCooldown(type) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decrement all cooldowns by 1 turn.
|
||||
/// Returns list of projectile types that completed cooldown this turn.
|
||||
/// </summary>
|
||||
public List<ProjectileType> DecrementCooldowns()
|
||||
{
|
||||
List<ProjectileType> completedCooldowns = new List<ProjectileType>();
|
||||
List<ProjectileType> types = new List<ProjectileType>(cooldowns.Keys);
|
||||
|
||||
foreach (var type in types)
|
||||
{
|
||||
if (cooldowns[type] > 0)
|
||||
{
|
||||
cooldowns[type]--;
|
||||
|
||||
if (cooldowns[type] == 0)
|
||||
{
|
||||
completedCooldowns.Add(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return completedCooldowns;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Usage Tracking
|
||||
|
||||
/// <summary>
|
||||
/// Record that a projectile type was used.
|
||||
/// </summary>
|
||||
public void RecordUsage(ProjectileType type)
|
||||
{
|
||||
lastUsedProjectile = type;
|
||||
|
||||
if (!usageCount.ContainsKey(type))
|
||||
{
|
||||
usageCount[type] = 0;
|
||||
}
|
||||
usageCount[type]++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get usage count for a projectile type.
|
||||
/// </summary>
|
||||
public int GetUsageCount(ProjectileType type)
|
||||
{
|
||||
return usageCount.ContainsKey(type) ? usageCount[type] : 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the last projectile type used by this player.
|
||||
/// </summary>
|
||||
public ProjectileType LastUsedProjectile => lastUsedProjectile;
|
||||
|
||||
/// <summary>
|
||||
/// Get total number of projectiles used by this player.
|
||||
/// </summary>
|
||||
public int TotalUsageCount
|
||||
{
|
||||
get
|
||||
{
|
||||
int total = 0;
|
||||
foreach (var count in usageCount.Values)
|
||||
{
|
||||
total += count;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd7545bfc92d4096b53954bab9884b15
|
||||
timeCreated: 1764797211
|
||||
23
Assets/Scripts/Minigames/FortFight/Data/PlayerData.cs
Normal file
23
Assets/Scripts/Minigames/FortFight/Data/PlayerData.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace Minigames.FortFight.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a player in the Fort Fight minigame
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class PlayerData
|
||||
{
|
||||
public string PlayerName;
|
||||
public bool IsAI;
|
||||
public int PlayerIndex; // 0 for Player One, 1 for Player Two/AI
|
||||
|
||||
public PlayerData(string name, bool isAI, int playerIndex)
|
||||
{
|
||||
PlayerName = name;
|
||||
IsAI = isAI;
|
||||
PlayerIndex = playerIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f310a90c43a9b3049b875c84f2d9043a
|
||||
94
Assets/Scripts/Minigames/FortFight/Data/ProjectileConfig.cs
Normal file
94
Assets/Scripts/Minigames/FortFight/Data/ProjectileConfig.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Configuration data for a projectile type.
|
||||
/// Stored centrally in FortFightSettings instead of individual ScriptableObject assets.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class ProjectileConfig
|
||||
{
|
||||
[Header("Identity")]
|
||||
[Tooltip("Type of projectile this config represents")]
|
||||
public ProjectileType projectileType;
|
||||
|
||||
[Tooltip("Unique string identifier (auto-generated from type)")]
|
||||
public string projectileId;
|
||||
|
||||
[Header("Prefab")]
|
||||
[Tooltip("Prefab for this projectile (should have ProjectileBase component)")]
|
||||
public GameObject prefab;
|
||||
|
||||
[Header("Ammunition System")]
|
||||
[Tooltip("Cooldown in turns after use")]
|
||||
public int cooldownTurns = 2;
|
||||
|
||||
[Header("UI")]
|
||||
[Tooltip("Icon sprite for ammunition UI")]
|
||||
public Sprite icon;
|
||||
|
||||
[Tooltip("Display name for this projectile type")]
|
||||
public string displayName;
|
||||
|
||||
[Tooltip("Description of projectile behavior")]
|
||||
[TextArea(2, 4)]
|
||||
public string description;
|
||||
|
||||
[Header("Combat Stats")]
|
||||
[Tooltip("Damage dealt on impact")]
|
||||
public float damage = 20f;
|
||||
|
||||
[Header("Physics")]
|
||||
[Tooltip("Mass for physics simulation (affects trajectory and force)")]
|
||||
public float mass = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// Get the ProjectileBase component from the prefab
|
||||
/// </summary>
|
||||
public Projectiles.ProjectileBase GetProjectileComponent()
|
||||
{
|
||||
if (prefab == null) return null;
|
||||
return prefab.GetComponent<Projectiles.ProjectileBase>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get damage value from config
|
||||
/// </summary>
|
||||
public float GetDamage()
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get mass value from config
|
||||
/// </summary>
|
||||
public float GetMass()
|
||||
{
|
||||
return mass;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate and auto-generate projectileId from type
|
||||
/// </summary>
|
||||
public void Validate()
|
||||
{
|
||||
if (string.IsNullOrEmpty(projectileId))
|
||||
{
|
||||
projectileId = GenerateIdFromType(projectileType);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(displayName))
|
||||
{
|
||||
displayName = projectileType.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private string GenerateIdFromType(ProjectileType type)
|
||||
{
|
||||
return type.ToString().ToLower();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d60235e77c7456380c10f9c145750bf
|
||||
timeCreated: 1764778577
|
||||
3
Assets/Scripts/Minigames/FortFight/Fort.meta
Normal file
3
Assets/Scripts/Minigames/FortFight/Fort.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5434add8e2e43cabd0ce4283636ca83
|
||||
timeCreated: 1764591745
|
||||
415
Assets/Scripts/Minigames/FortFight/Fort/FortBlock.cs
Normal file
415
Assets/Scripts/Minigames/FortFight/Fort/FortBlock.cs
Normal file
@@ -0,0 +1,415 @@
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine;
|
||||
using Minigames.FortFight.Data;
|
||||
|
||||
namespace Minigames.FortFight.Fort
|
||||
{
|
||||
/// <summary>
|
||||
/// Individual fort block with HP, material properties, and physics.
|
||||
/// Component attached to each block GameObject in a fort prefab.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Rigidbody2D), typeof(Collider2D))]
|
||||
public class FortBlock : ManagedBehaviour
|
||||
{
|
||||
#region Inspector Properties
|
||||
|
||||
[Header("Block Configuration")]
|
||||
[SerializeField] private BlockMaterial material = BlockMaterial.Cardboard;
|
||||
[SerializeField] private BlockSize size = BlockSize.Medium;
|
||||
[SerializeField] private bool isWeakPoint = false;
|
||||
|
||||
[Tooltip("Fixed HP value for this block (default: 10)")]
|
||||
[SerializeField] private float blockHp = 10f;
|
||||
|
||||
[Header("Weak Point Settings (if applicable)")]
|
||||
[Tooltip("Visual indicator shown in editor/game for weak points")]
|
||||
[SerializeField] private GameObject weakPointVisualIndicator;
|
||||
[Tooltip("Visual explosion effect prefab")]
|
||||
[SerializeField] private GameObject explosionEffectPrefab;
|
||||
|
||||
[Header("Visual Feedback")]
|
||||
[SerializeField] private SpriteRenderer spriteRenderer;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Fired when this block is destroyed. Parameters: (FortBlock block, float damageTaken)
|
||||
/// </summary>
|
||||
public event Action<FortBlock, float> OnBlockDestroyed;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when this block takes damage. Parameters: (float currentHP, float maxHP)
|
||||
/// </summary>
|
||||
public event Action<float, float> OnBlockDamaged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public BlockMaterial Material => material;
|
||||
public BlockSize Size => size;
|
||||
public bool IsWeakPoint => isWeakPoint;
|
||||
public float CurrentHp => currentHp;
|
||||
public float MaxHp => maxHp;
|
||||
public float HpPercentage => maxHp > 0 ? (currentHp / maxHp) * 100f : 0f;
|
||||
public bool IsDestroyed => isDestroyed;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private State
|
||||
|
||||
private float maxHp;
|
||||
private float currentHp;
|
||||
private FortController parentFort;
|
||||
private Rigidbody2D rb2D;
|
||||
private Collider2D blockCollider;
|
||||
private bool isDestroyed = false;
|
||||
|
||||
// Cached settings
|
||||
private AppleHills.Core.Settings.IFortFightSettings _cachedSettings;
|
||||
private AppleHills.Core.Settings.IFortFightSettings CachedSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedSettings == null)
|
||||
{
|
||||
_cachedSettings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
}
|
||||
return _cachedSettings;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Lifecycle
|
||||
|
||||
internal override void OnManagedDestroy()
|
||||
{
|
||||
base.OnManagedDestroy();
|
||||
|
||||
// Unsubscribe events
|
||||
OnBlockDestroyed = null;
|
||||
OnBlockDamaged = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Initialization
|
||||
|
||||
/// <summary>
|
||||
/// Initialize this block. Called explicitly by parent FortController.
|
||||
/// DO NOT call from Awake/Start - parent controls initialization timing.
|
||||
/// </summary>
|
||||
public void Initialize()
|
||||
{
|
||||
// Automatically assign block to correct layer from settings
|
||||
var settings = CachedSettings;
|
||||
if (settings != null && settings.FortBlockLayer >= 0 && gameObject.layer != settings.FortBlockLayer)
|
||||
{
|
||||
gameObject.layer = settings.FortBlockLayer;
|
||||
Logging.Debug($"[FortBlock] Assigned {gameObject.name} to layer {LayerMask.LayerToName(settings.FortBlockLayer)}");
|
||||
}
|
||||
|
||||
// Cache components
|
||||
rb2D = GetComponent<Rigidbody2D>();
|
||||
blockCollider = GetComponent<Collider2D>();
|
||||
|
||||
if (spriteRenderer == null)
|
||||
{
|
||||
spriteRenderer = GetComponent<SpriteRenderer>();
|
||||
}
|
||||
|
||||
if (isDestroyed)
|
||||
{
|
||||
Logging.Warning($"[FortBlock] Cannot initialize destroyed block {gameObject.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate HP based on material and size
|
||||
CalculateHp();
|
||||
|
||||
// Configure physics properties
|
||||
ConfigurePhysics();
|
||||
|
||||
// Show/hide weak point indicator
|
||||
if (weakPointVisualIndicator != null)
|
||||
{
|
||||
weakPointVisualIndicator.SetActive(isWeakPoint);
|
||||
}
|
||||
|
||||
Logging.Debug($"[FortBlock] {gameObject.name} initialized: {material} {size}, HP: {maxHp}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region HP Calculation
|
||||
|
||||
private void CalculateHp()
|
||||
{
|
||||
// Use fixed block HP value (default 10)
|
||||
maxHp = blockHp;
|
||||
currentHp = maxHp;
|
||||
|
||||
Logging.Debug($"[FortBlock] {gameObject.name} initialized: {material} {size}, HP: {maxHp}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Physics Configuration
|
||||
|
||||
private void ConfigurePhysics()
|
||||
{
|
||||
if (rb2D == null) return;
|
||||
|
||||
// Get material config
|
||||
var materialConfig = CachedSettings.GetMaterialConfig(material);
|
||||
float baseMass = materialConfig?.baseMass ?? 1f;
|
||||
|
||||
// Get size config
|
||||
var sizeConfig = CachedSettings.GetSizeConfig(size);
|
||||
float sizeMultiplier = sizeConfig?.massMultiplier ?? 1f;
|
||||
|
||||
rb2D.mass = baseMass * sizeMultiplier;
|
||||
rb2D.gravityScale = CachedSettings.PhysicsGravityScale;
|
||||
rb2D.collisionDetectionMode = CollisionDetectionMode2D.Continuous;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Damage System
|
||||
|
||||
/// <summary>
|
||||
/// Apply damage to this block
|
||||
/// </summary>
|
||||
public void TakeDamage(float damage)
|
||||
{
|
||||
if (isDestroyed) return;
|
||||
|
||||
currentHp -= damage;
|
||||
currentHp = Mathf.Max(0f, currentHp);
|
||||
|
||||
Logging.Debug($"[FortBlock] {gameObject.name} took {damage} damage. HP: {currentHp}/{maxHp} ({HpPercentage:F1}%)");
|
||||
|
||||
OnBlockDamaged?.Invoke(currentHp, maxHp);
|
||||
|
||||
// Visual feedback
|
||||
UpdateVisualDamage();
|
||||
|
||||
// Check if destroyed
|
||||
if (currentHp <= 0f)
|
||||
{
|
||||
DestroyBlock();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateVisualDamage()
|
||||
{
|
||||
if (spriteRenderer == null) return;
|
||||
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
Color targetColor = settings?.DamageColorTint ?? new Color(0.5f, 0.5f, 0.5f);
|
||||
|
||||
// Darken sprite based on damage
|
||||
float damagePercent = 1f - (currentHp / maxHp);
|
||||
Color damageColor = Color.Lerp(Color.white, targetColor, damagePercent);
|
||||
spriteRenderer.color = damageColor;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Destruction
|
||||
|
||||
private void DestroyBlock()
|
||||
{
|
||||
if (isDestroyed) return;
|
||||
isDestroyed = true;
|
||||
|
||||
Logging.Debug($"[FortBlock] {gameObject.name} destroyed! Weak point: {isWeakPoint}");
|
||||
|
||||
// Trigger explosion if weak point
|
||||
if (isWeakPoint)
|
||||
{
|
||||
TriggerWeakPointExplosion();
|
||||
}
|
||||
|
||||
// Notify listeners
|
||||
OnBlockDestroyed?.Invoke(this, maxHp);
|
||||
|
||||
// Spawn destruction effects (placeholder)
|
||||
SpawnDestructionEffect();
|
||||
|
||||
// Destroy GameObject
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
private void TriggerWeakPointExplosion()
|
||||
{
|
||||
float explosionRadius = CachedSettings.WeakPointExplosionRadius;
|
||||
float explosionDamage = CachedSettings.WeakPointExplosionDamage;
|
||||
float explosionForce = CachedSettings.WeakPointExplosionForce;
|
||||
|
||||
Logging.Debug($"[FortBlock] ========================================");
|
||||
Logging.Debug($"[FortBlock] 💥 WEAK POINT EXPLOSION TRIGGERED!");
|
||||
Logging.Debug($"[FortBlock] Position: {transform.position}");
|
||||
Logging.Debug($"[FortBlock] Explosion Radius: {explosionRadius}");
|
||||
Logging.Debug($"[FortBlock] Explosion Damage: {explosionDamage}");
|
||||
Logging.Debug($"[FortBlock] Explosion Force: {explosionForce}");
|
||||
Logging.Debug($"[FortBlock] ========================================");
|
||||
|
||||
// Spawn explosion effect
|
||||
if (explosionEffectPrefab != null)
|
||||
{
|
||||
Logging.Debug($"[FortBlock] Spawning explosion effect prefab");
|
||||
GameObject explosion = Instantiate(explosionEffectPrefab, transform.position, Quaternion.identity);
|
||||
|
||||
// Dynamically determine cleanup time from particle system
|
||||
float lifetime = GetEffectLifetime(explosion);
|
||||
Destroy(explosion, lifetime);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Debug($"[FortBlock] No explosion effect prefab (visual only)");
|
||||
}
|
||||
|
||||
// Find nearby blocks and damage them
|
||||
Collider2D[] nearbyColliders = Physics2D.OverlapCircleAll(transform.position, explosionRadius);
|
||||
|
||||
Logging.Debug($"[FortBlock] Physics2D.OverlapCircleAll found {nearbyColliders.Length} colliders");
|
||||
|
||||
if (nearbyColliders.Length <= 1)
|
||||
{
|
||||
Logging.Warning($"[FortBlock] ⚠️ Only found {nearbyColliders.Length} colliders! Other blocks need BoxCollider2D with 'Is Trigger' UNCHECKED");
|
||||
}
|
||||
|
||||
int blocksHit = 0;
|
||||
foreach (Collider2D col in nearbyColliders)
|
||||
{
|
||||
if (col.gameObject == gameObject)
|
||||
{
|
||||
Logging.Debug($"[FortBlock] Skipping self");
|
||||
continue; // Skip self
|
||||
}
|
||||
|
||||
Logging.Debug($"[FortBlock] Checking collider: {col.gameObject.name}");
|
||||
|
||||
FortBlock nearbyBlock = col.GetComponent<FortBlock>();
|
||||
if (nearbyBlock != null && !nearbyBlock.isDestroyed)
|
||||
{
|
||||
Vector2 explosionCenter = transform.position;
|
||||
float distance = Vector2.Distance(explosionCenter, nearbyBlock.transform.position);
|
||||
|
||||
// Calculate damage with falloff
|
||||
float damageFalloff = 1f - (distance / explosionRadius);
|
||||
float actualDamage = explosionDamage * damageFalloff;
|
||||
|
||||
// Apply damage
|
||||
nearbyBlock.TakeDamage(actualDamage);
|
||||
|
||||
// Apply explosion force (2D equivalent of AddExplosionForce)
|
||||
Rigidbody2D nearbyRb = nearbyBlock.GetComponent<Rigidbody2D>();
|
||||
if (nearbyRb != null)
|
||||
{
|
||||
ApplyExplosionForce2D(nearbyRb, explosionForce, explosionCenter, explosionRadius);
|
||||
Logging.Debug($"[FortBlock] ✓ HIT: {nearbyBlock.gameObject.name} - Damage: {actualDamage:F1}, Force applied from center");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Debug($"[FortBlock] ✓ HIT: {nearbyBlock.gameObject.name} - Damage: {actualDamage:F1} (no Rigidbody2D)");
|
||||
}
|
||||
|
||||
blocksHit++;
|
||||
}
|
||||
else if (nearbyBlock == null)
|
||||
{
|
||||
Logging.Debug($"[FortBlock] × MISS: {col.gameObject.name} has no FortBlock component");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Debug($"[FortBlock] × SKIP: {col.gameObject.name} already destroyed");
|
||||
}
|
||||
}
|
||||
|
||||
Logging.Debug($"[FortBlock] Explosion complete. Damaged {blocksHit} blocks");
|
||||
Logging.Debug($"[FortBlock] ========================================");
|
||||
|
||||
// TODO: Add screen shake effect
|
||||
// TODO: Play explosion sound via AudioManager
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply explosion force to a Rigidbody2D (2D equivalent of Rigidbody.AddExplosionForce).
|
||||
/// Force decreases with distance from explosion center.
|
||||
/// </summary>
|
||||
private void ApplyExplosionForce2D(Rigidbody2D rb, float force, Vector2 center, float radius)
|
||||
{
|
||||
Vector2 direction = (rb.position - center);
|
||||
float distance = direction.magnitude;
|
||||
|
||||
if (distance == 0f) return; // Avoid division by zero
|
||||
|
||||
// Normalize direction
|
||||
direction /= distance;
|
||||
|
||||
// Calculate force with linear falloff (like Unity's 3D AddExplosionForce)
|
||||
float forceMagnitude = force * (1f - (distance / radius));
|
||||
|
||||
// Apply force as impulse
|
||||
rb.AddForce(direction * forceMagnitude, ForceMode2D.Impulse);
|
||||
}
|
||||
|
||||
private void SpawnDestructionEffect()
|
||||
{
|
||||
// Placeholder for destruction particles
|
||||
// TODO: Create material-specific destruction effects
|
||||
Logging.Debug($"[FortBlock] Spawning destruction effect for {material} block");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the lifetime of an effect by reading particle system StartLifetime.
|
||||
/// Falls back to 3 seconds if no particle system found.
|
||||
/// </summary>
|
||||
private float GetEffectLifetime(GameObject effect)
|
||||
{
|
||||
// Try to read from ParticleSystem
|
||||
ParticleSystem ps = effect.GetComponent<ParticleSystem>();
|
||||
if (ps != null)
|
||||
{
|
||||
return ps.main.startLifetime.constantMax + 0.5f; // Add small buffer
|
||||
}
|
||||
|
||||
// Try to read from child particle systems
|
||||
ParticleSystem childPs = effect.GetComponentInChildren<ParticleSystem>();
|
||||
if (childPs != null)
|
||||
{
|
||||
return childPs.main.startLifetime.constantMax + 0.5f;
|
||||
}
|
||||
|
||||
// Fallback for non-particle effects
|
||||
return 3f;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Debug Helpers
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnDrawGizmosSelected()
|
||||
{
|
||||
if (isWeakPoint)
|
||||
{
|
||||
// Draw explosion radius in editor using settings
|
||||
float radius = AppleHills.SettingsAccess.GetWeakPointExplosionRadius();
|
||||
Gizmos.color = Color.red;
|
||||
Gizmos.DrawWireSphere(transform.position, radius);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ace8ce8bea324389a9955e63081ccff7
|
||||
timeCreated: 1764591745
|
||||
391
Assets/Scripts/Minigames/FortFight/Fort/FortController.cs
Normal file
391
Assets/Scripts/Minigames/FortFight/Fort/FortController.cs
Normal file
@@ -0,0 +1,391 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine;
|
||||
using AppleHills.Core.Settings;
|
||||
|
||||
namespace Minigames.FortFight.Fort
|
||||
{
|
||||
/// <summary>
|
||||
/// Root component of fort prefabs. Manages collection of child FortBlocks and tracks total HP.
|
||||
/// </summary>
|
||||
public class FortController : ManagedBehaviour
|
||||
{
|
||||
#region Inspector Properties
|
||||
|
||||
[Header("Fort Configuration")]
|
||||
[SerializeField] private string fortName = "Unnamed Fort";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Fired when fort takes damage. Parameters: (float damage, float hpPercentage)
|
||||
/// </summary>
|
||||
public event Action<float, float> OnFortDamaged;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when fort is defeated (HP < 30%)
|
||||
/// </summary>
|
||||
public event Action OnFortDefeated;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when a block is destroyed. Parameters: (FortBlock block)
|
||||
/// </summary>
|
||||
public event Action<FortBlock> OnBlockDestroyed;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public string FortName => fortName;
|
||||
public float MaxFortHp => _maxFortHp;
|
||||
public float CurrentFortHp => _currentFortHp;
|
||||
public float HpPercentage => _maxFortHp > 0 ? (_currentFortHp / _maxFortHp) * 100f : 0f;
|
||||
public int TotalBlockCount => _blocks.Count;
|
||||
public int InitialBlockCount => _initialBlockCount;
|
||||
public bool IsDefeated { get; private set; }
|
||||
|
||||
// Aliases for consistency
|
||||
public float MaxHp => _maxFortHp;
|
||||
public float CurrentHp => _currentFortHp;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private State
|
||||
|
||||
private List<FortBlock> _blocks = new List<FortBlock>();
|
||||
private float _maxFortHp = 0f;
|
||||
private float _currentFortHp = 0f;
|
||||
private int _initialBlockCount = 0;
|
||||
private bool _isInitialized = false;
|
||||
|
||||
// Cached settings
|
||||
private IFortFightSettings _cachedSettings;
|
||||
private IFortFightSettings CachedSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedSettings == null)
|
||||
{
|
||||
_cachedSettings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
}
|
||||
return _cachedSettings;
|
||||
}
|
||||
}
|
||||
|
||||
private FortFightDeveloperSettings _cachedDevSettings;
|
||||
private FortFightDeveloperSettings CachedDevSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedDevSettings == null)
|
||||
{
|
||||
_cachedDevSettings = GameManager.GetDeveloperSettings<FortFightDeveloperSettings>();
|
||||
}
|
||||
return _cachedDevSettings;
|
||||
}
|
||||
}
|
||||
|
||||
private bool ShowDebugInfo => CachedDevSettings?.FortShowDebugInfo ?? false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Lifecycle
|
||||
|
||||
internal override void OnManagedStart()
|
||||
{
|
||||
base.OnManagedStart();
|
||||
|
||||
// Self-initialize: discover blocks, register with manager
|
||||
InitializeFort();
|
||||
}
|
||||
|
||||
internal override void OnManagedDestroy()
|
||||
{
|
||||
base.OnManagedDestroy();
|
||||
|
||||
// Unsubscribe from all block events
|
||||
foreach (FortBlock block in _blocks)
|
||||
{
|
||||
if (block != null)
|
||||
{
|
||||
block.OnBlockDestroyed -= HandleBlockDestroyed;
|
||||
block.OnBlockDamaged -= HandleBlockDamaged;
|
||||
}
|
||||
}
|
||||
|
||||
_blocks.Clear();
|
||||
|
||||
// Clear events
|
||||
OnFortDamaged = null;
|
||||
OnFortDefeated = null;
|
||||
OnBlockDestroyed = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Initialization
|
||||
|
||||
/// <summary>
|
||||
/// Initialize fort: discover child blocks, calculate HP, register with manager.
|
||||
/// Called automatically in Start() - no external calls needed.
|
||||
/// </summary>
|
||||
private void InitializeFort()
|
||||
{
|
||||
if (_isInitialized)
|
||||
{
|
||||
Logging.Warning($"[FortController] {fortName} already initialized!");
|
||||
return;
|
||||
}
|
||||
|
||||
Logging.Debug($"[FortController] {fortName} - Starting self-initialization");
|
||||
|
||||
// Step 1: Discover and register child blocks
|
||||
DiscoverAndRegisterBlocks();
|
||||
|
||||
// Step 2: Register with central manager
|
||||
RegisterWithManager();
|
||||
|
||||
_isInitialized = true;
|
||||
Logging.Debug($"[FortController] {fortName} - Initialization complete");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Discover, initialize, and register all child blocks.
|
||||
/// This ensures deterministic initialization order.
|
||||
/// </summary>
|
||||
private void DiscoverAndRegisterBlocks()
|
||||
{
|
||||
FortBlock[] childBlocks = GetComponentsInChildren<FortBlock>();
|
||||
|
||||
if (childBlocks.Length == 0)
|
||||
{
|
||||
Logging.Error($"[FortController] {fortName} has no blocks!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (childBlocks.Length > 10)
|
||||
{
|
||||
Logging.Warning($"[FortController] {fortName} has {childBlocks.Length} blocks (max 10 recommended)");
|
||||
}
|
||||
|
||||
Logging.Debug($"[FortController] {fortName} - Discovered {childBlocks.Length} blocks, initializing...");
|
||||
|
||||
// Step 1: Initialize each block (calculate HP, configure physics)
|
||||
foreach (FortBlock block in childBlocks)
|
||||
{
|
||||
block.Initialize();
|
||||
}
|
||||
|
||||
// Step 2: Register each block (subscribe to events, track HP)
|
||||
foreach (FortBlock block in childBlocks)
|
||||
{
|
||||
RegisterBlock(block);
|
||||
}
|
||||
|
||||
// Step 3: Initialize current HP to match max HP (sum of all blocks)
|
||||
_currentFortHp = _maxFortHp;
|
||||
|
||||
_initialBlockCount = _blocks.Count;
|
||||
Logging.Debug($"[FortController] {fortName} - Initialized and registered {_blocks.Count} blocks, Total HP: {_maxFortHp:F0}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register this fort with the central FortManager.
|
||||
/// Manager determines if player/enemy and handles UI binding.
|
||||
/// </summary>
|
||||
private void RegisterWithManager()
|
||||
{
|
||||
Core.FortManager manager = Core.FortManager.Instance;
|
||||
|
||||
if (manager == null)
|
||||
{
|
||||
Logging.Error($"[FortController] {fortName} - FortManager not found! Cannot complete initialization.");
|
||||
return;
|
||||
}
|
||||
|
||||
manager.RegisterFort(this);
|
||||
Logging.Debug($"[FortController] {fortName} - Registered with FortManager");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Block Management
|
||||
|
||||
/// <summary>
|
||||
/// Register a block with this fort controller. Called by FortBlock on start.
|
||||
/// </summary>
|
||||
public void RegisterBlock(FortBlock block)
|
||||
{
|
||||
if (block == null) return;
|
||||
|
||||
if (!_blocks.Contains(block))
|
||||
{
|
||||
_blocks.Add(block);
|
||||
|
||||
// Only add to max HP, current HP will be calculated once at end of initialization
|
||||
_maxFortHp += block.MaxHp;
|
||||
|
||||
// Subscribe to block events
|
||||
block.OnBlockDestroyed += HandleBlockDestroyed;
|
||||
block.OnBlockDamaged += HandleBlockDamaged;
|
||||
|
||||
if (ShowDebugInfo)
|
||||
{
|
||||
Logging.Debug($"[FortController] Registered block: {block.gameObject.name} ({block.Material} {block.Size}, HP: {block.MaxHp})");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all blocks marked as weak points
|
||||
/// </summary>
|
||||
public List<FortBlock> GetWeakPoints()
|
||||
{
|
||||
return _blocks.Where(b => b != null && b.IsWeakPoint).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all remaining blocks
|
||||
/// </summary>
|
||||
public List<FortBlock> GetAllBlocks()
|
||||
{
|
||||
return new List<FortBlock>(_blocks);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a random block (for AI targeting)
|
||||
/// </summary>
|
||||
public FortBlock GetRandomBlock()
|
||||
{
|
||||
if (_blocks.Count == 0) return null;
|
||||
return _blocks[UnityEngine.Random.Range(0, _blocks.Count)];
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
private void HandleBlockDestroyed(FortBlock block, float blockMaxHp)
|
||||
{
|
||||
if (block == null) return;
|
||||
|
||||
Logging.Debug($"[FortController] {fortName} - Block destroyed: {block.gameObject.name}");
|
||||
|
||||
// Remove from list
|
||||
_blocks.Remove(block);
|
||||
|
||||
// Recalculate HP by summing all remaining blocks (consistent calculation method)
|
||||
RecalculateFortHp();
|
||||
|
||||
// Notify listeners
|
||||
OnBlockDestroyed?.Invoke(block);
|
||||
OnFortDamaged?.Invoke(blockMaxHp, HpPercentage);
|
||||
|
||||
// Check defeat condition
|
||||
CheckDefeatCondition();
|
||||
|
||||
if (ShowDebugInfo)
|
||||
{
|
||||
Logging.Debug($"[FortController] {fortName} - HP: {_currentFortHp:F0}/{_maxFortHp:F0} ({HpPercentage:F1}%), Blocks: {_blocks.Count}/{_initialBlockCount}");
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleBlockDamaged(float currentBlockHp, float maxBlockHp)
|
||||
{
|
||||
// Block damaged but not destroyed
|
||||
Logging.Debug($"[FortController] {fortName} - Block damaged! CurrentBlockHP: {currentBlockHp}/{maxBlockHp}");
|
||||
|
||||
// Recalculate current fort HP based on all block HP
|
||||
RecalculateFortHp();
|
||||
|
||||
// Notify UI to update
|
||||
int listenerCount = OnFortDamaged?.GetInvocationList()?.Length ?? 0;
|
||||
Logging.Debug($"[FortController] {fortName} - Firing OnFortDamaged event. HP: {HpPercentage:F1}%. Listeners: {listenerCount}");
|
||||
OnFortDamaged?.Invoke(0f, HpPercentage);
|
||||
|
||||
// Check defeat condition after damage
|
||||
CheckDefeatCondition();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recalculate total fort HP by summing all block HP
|
||||
/// </summary>
|
||||
private void RecalculateFortHp()
|
||||
{
|
||||
_currentFortHp = 0f;
|
||||
foreach (var block in _blocks)
|
||||
{
|
||||
if (block != null)
|
||||
{
|
||||
_currentFortHp += block.CurrentHp;
|
||||
}
|
||||
}
|
||||
|
||||
if (ShowDebugInfo)
|
||||
{
|
||||
Logging.Debug($"[FortController] {fortName} - HP recalculated: {_currentFortHp:F0}/{_maxFortHp:F0} ({HpPercentage:F1}%)");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Defeat Condition
|
||||
|
||||
private void CheckDefeatCondition()
|
||||
{
|
||||
if (IsDefeated)
|
||||
{
|
||||
Logging.Debug($"[FortController] {fortName} - Already defeated, skipping check");
|
||||
return;
|
||||
}
|
||||
|
||||
float defeatThreshold = CachedSettings?.FortDefeatThreshold ?? 0.3f;
|
||||
float defeatThresholdPercent = defeatThreshold * 100f;
|
||||
|
||||
Logging.Debug($"[FortController] {fortName} - Checking defeat: HP={_currentFortHp:F1}/{_maxFortHp:F1} ({HpPercentage:F1}%) vs threshold={defeatThresholdPercent:F1}%");
|
||||
|
||||
// Defeat if HP at or below threshold
|
||||
if (HpPercentage <= defeatThresholdPercent)
|
||||
{
|
||||
IsDefeated = true;
|
||||
|
||||
int listeners = OnFortDefeated?.GetInvocationList()?.Length ?? 0;
|
||||
Logging.Debug($"[FortController] {fortName} DEFEATED! Final HP: {HpPercentage:F1}% (threshold: {defeatThresholdPercent:F1}%). Firing event to {listeners} listeners...");
|
||||
|
||||
OnFortDefeated?.Invoke();
|
||||
|
||||
Logging.Debug($"[FortController] {fortName} - OnFortDefeated event fired");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Debug($"[FortController] {fortName} - Not defeated yet ({HpPercentage:F1}% >= {defeatThresholdPercent:F1}%)");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Debug Helpers
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (!ShowDebugInfo || !Application.isPlaying) return;
|
||||
|
||||
// Display fort HP in scene view (for testing)
|
||||
Vector3 screenPos = Camera.main.WorldToScreenPoint(transform.position + Vector3.up * 2f);
|
||||
if (screenPos.z > 0)
|
||||
{
|
||||
GUI.color = IsDefeated ? Color.red : Color.white;
|
||||
GUI.Label(new Rect(screenPos.x - 50, Screen.height - screenPos.y, 100, 30),
|
||||
$"{fortName}\nHP: {HpPercentage:F0}%");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05031222348c421ab564757f52f24952
|
||||
timeCreated: 1764591745
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user