Closed #26 Camera change bug fix

This commit is contained in:
M1_IDMhan 2023-08-29 13:23:27 +09:00
parent c752857107
commit 575c6ef2d0
12 changed files with 110 additions and 71 deletions

View File

@ -505,7 +505,7 @@ PrefabInstance:
- target: {fileID: 2347074, guid: e03ec6b6ff510d545ace4e5794f6fab9, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 4189525e08801394b984887825dfe498, type: 2}
objectReference: {fileID: 2100000, guid: 34ccd2d694bd8724d985a0f409ebea6c, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -702,6 +702,7 @@ MonoBehaviour:
- {fileID: 21300000, guid: fa70a195a66db4c7fb6180f4205a06b1, type: 3}
- {fileID: 21300000, guid: d7aae5ed9e4924be4ac2fe09b2f729a9, type: 3}
- {fileID: 21300000, guid: 9180a011ac08440f89deb0b7aa2820f2, type: 3}
cursorTexture: {fileID: 2800000, guid: 5d76030a282af4f58a2ea98a00c1172c, type: 3}
--- !u!4 &107190135
Transform:
m_ObjectHideFlags: 0
@ -3005,7 +3006,7 @@ PrefabInstance:
- target: {fileID: 2347074, guid: e03ec6b6ff510d545ace4e5794f6fab9, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 4189525e08801394b984887825dfe498, type: 2}
objectReference: {fileID: 2100000, guid: 34ccd2d694bd8724d985a0f409ebea6c, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -3333,7 +3334,7 @@ PrefabInstance:
- target: {fileID: 2347074, guid: e03ec6b6ff510d545ace4e5794f6fab9, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 4189525e08801394b984887825dfe498, type: 2}
objectReference: {fileID: 2100000, guid: 34ccd2d694bd8724d985a0f409ebea6c, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -9280,7 +9281,7 @@ PrefabInstance:
- target: {fileID: 2337722, guid: a04e12c67e8230e4aa0ca4061ed89fa4, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 4189525e08801394b984887825dfe498, type: 2}
objectReference: {fileID: 2100000, guid: 34ccd2d694bd8724d985a0f409ebea6c, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -9659,7 +9660,7 @@ PrefabInstance:
- target: {fileID: 2343364, guid: e1c4cc5b9a7d0d7479734ea4167d417e, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 4189525e08801394b984887825dfe498, type: 2}
objectReference: {fileID: 2100000, guid: 34ccd2d694bd8724d985a0f409ebea6c, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -11899,7 +11900,7 @@ PrefabInstance:
- target: {fileID: 2343364, guid: e1c4cc5b9a7d0d7479734ea4167d417e, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 4189525e08801394b984887825dfe498, type: 2}
objectReference: {fileID: 2100000, guid: 34ccd2d694bd8724d985a0f409ebea6c, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -12712,7 +12713,7 @@ PrefabInstance:
- target: {fileID: 2357522, guid: 35a790efcca549d489da6d25d7fb77ee, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 4189525e08801394b984887825dfe498, type: 2}
objectReference: {fileID: 2100000, guid: 34ccd2d694bd8724d985a0f409ebea6c, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -13792,7 +13793,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1871370245}
serializedVersion: 2
m_LocalRotation: {x: 0.67640686, y: -0.0000002980232, z: 0.0000002980232, w: 0.7365283}
m_LocalRotation: {x: 0.67640686, y: 0.00000023841855, z: -0.0000002980232, w: 0.7365282}
m_LocalPosition: {x: -0.0000002384187, y: 120, z: -10.000001}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
@ -14354,7 +14355,7 @@ PrefabInstance:
- target: {fileID: 2368162, guid: a70152ac9ec4ea14e94da160b98b6fad, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 2100000, guid: 4189525e08801394b984887825dfe498, type: 2}
objectReference: {fileID: 2100000, guid: 34ccd2d694bd8724d985a0f409ebea6c, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@ -15256,7 +15257,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_persistent: 0
cursorTexture: {fileID: 2800000, guid: 5d76030a282af4f58a2ea98a00c1172c, type: 3}
--- !u!1001 &2117062064
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -44,12 +44,14 @@ public class CameraController : MonoBehaviour
{
assaultCam.Priority = 1;
dredgeCam.Priority = 0;
InShipCam.Priority = 0;
}
public void CamDredgeMode()
{
dredgeCam.Priority = 1;
assaultCam.Priority = 0;
InShipCam.Priority = 0;
}
public void CamInShipMode()

View File

@ -22,4 +22,5 @@ public class DataManager : Singleton<DataManager>
[Title("DataBase", "Sprites")]
public Sprite[] cardType;
public Texture2D cursorTexture;
}

View File

@ -28,7 +28,7 @@ public class GameManager : Singleton<GameManager>
private void Start()
{
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Confined;
}
public void testPrint()

View File

@ -32,7 +32,7 @@ namespace _02.Scripts.WaterAndShip
public bool IsAssaultMode { get; set; }
public bool IsInShipMode { get; set; }
public bool IsdredgeMode { get; set; }
public bool IsDredgeMode { get; set; }
public bool IsTakeAim { get; set; }
private void Init()
@ -99,30 +99,25 @@ namespace _02.Scripts.WaterAndShip
private void OnAssaultMode(InputValue value) // V
{
if (IsAssaultMode)
{
SwitchToDredgeMode();
}
else
{
SwitchToAssaultMode();
}
SwitchAssaultMode(!IsAssaultMode);
}
private void SwitchToDredgeMode()
private void SwitchAssaultMode(bool isOn)
{
GameManager.Inst.CameraController.CamDredgeMode();
UiManager.Inst.CardLayoutGroupAnimator.Reverse();
IsAssaultMode = false;
IsdredgeMode = true;
}
private void SwitchToAssaultMode()
{
GameManager.Inst.CameraController.CamAssaultMode();
UiManager.Inst.CardLayoutGroupAnimator.Play();
IsAssaultMode = true;
IsdredgeMode = false;
if (isOn)
{
SwitchTakeAim(false);
SwitchInShipMode(false);
GameManager.Inst.CameraController.CamAssaultMode();
UiManager.Inst.CardLayoutGroupAnimator.Play();
IsAssaultMode = true;
}
else if (IsAssaultMode)
{
GameManager.Inst.CameraController.CamDredgeMode();
UiManager.Inst.CardLayoutGroupAnimator.Reverse();
IsAssaultMode = false;
}
}
#endregion
@ -136,19 +131,23 @@ namespace _02.Scripts.WaterAndShip
private void OnInteractionHold(InputValue value) //F Hold
{
if (IsInShipMode)
{
GameManager.Inst.CameraController.CamDredgeMode();
IsdredgeMode = true;
IsAssaultMode = false;
IsInShipMode = false;
}
else
SwitchInShipMode(!IsInShipMode);
}
private void SwitchInShipMode(bool isOn)
{
if (isOn)
{
SwitchTakeAim(false);
SwitchAssaultMode(false);
GameManager.Inst.CameraController.CamInShipMode();
IsInShipMode = true;
IsAssaultMode = false;
IsdredgeMode = false;
}
else if (IsInShipMode)
{
GameManager.Inst.CameraController.CamDredgeMode();
IsInShipMode = false;
}
}
@ -161,9 +160,28 @@ namespace _02.Scripts.WaterAndShip
private void OnTakeAim(InputValue value) // Space
{
IsTakeAim = !IsTakeAim;
GameManager.Inst.CameraController.CamTakeAim(IsTakeAim);
UiManager.Inst.AimOnOff(IsTakeAim);
SwitchTakeAim(!IsTakeAim);
}
private void SwitchTakeAim(bool isOn)
{
if (isOn)
{
SwitchAssaultMode(false);
SwitchInShipMode(false);
GameManager.Inst.CameraController.CamTakeAim(true);
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
IsTakeAim = true;
}
else if (IsTakeAim)
{
GameManager.Inst.CameraController.CamTakeAim(false);
Cursor.visible = true;
Cursor.lockState = CursorLockMode.Confined;
IsTakeAim = false;
}
UiManager.Inst.AimOnOff(isOn);
}
}
}

View File

@ -13,7 +13,7 @@ public class UiManager : Singleton<UiManager>
[Title("TakeAim")]
private GameObject takeAim;
public Texture2D cursorTexture;
private Texture2D cursorTexture;
private bool isTakeAim;
private void Init()
@ -27,14 +27,20 @@ public class UiManager : Singleton<UiManager>
{
Init();
}
private void OnGUI()
private void Start()
{
if (isTakeAim) return;
Vector2 mousePosition = new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y);
GUI.DrawTexture(new Rect(mousePosition.x, mousePosition.y, cursorTexture.width, cursorTexture.height), cursorTexture);
cursorTexture = DataManager.Inst.cursorTexture;
Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto);
}
// private void OnGUI()
// {
// if (isTakeAim) return;
// Vector2 mousePosition = new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y);
// GUI.DrawTexture(new Rect(mousePosition.x, mousePosition.y, cursorTexture.width, cursorTexture.height), cursorTexture);
// }
public void AddCard()
{
Instantiate(DataManager.Inst.assaultCard, cardLayoutGroup);

View File

@ -109,7 +109,7 @@ Material:
- _ZWrite: 1
m_Colors:
- Color_1139F668: {r: 1, g: 1, b: 1, a: 0.21176471}
- Color_198818EE: {r: 0, g: 0.45349112, b: 1.498, a: 0.2}
- Color_198818EE: {r: 0.0454739, g: 0, b: 1.498, a: 0.25490198}
- Color_626750DD: {r: 2, g: 2, b: 2, a: 1}
- Color_77A2EDE9: {r: 31.626795, g: 31.626795, b: 31.626795, a: 1}
- Vector2_1E1B6943: {r: 1, g: 1, b: 0, a: 0}

View File

@ -8,18 +8,22 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CPT_Terrain_01
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Shader: {fileID: 4800000, guid: bee44b4a58655ee4cbff107302a3e131, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _SPECULAR_SETUP
m_InvalidKeywords: []
- DR_GRADIENT_ON
- DR_OUTLINE_ON
- _CELPRIMARYMODE_SINGLE
- _DETAILMAPBLENDINGMODE_MULTIPLY
- _TEXTUREBLENDINGMODE_MULTIPLY
m_InvalidKeywords:
- _UNITYSHADOWMODE_NONE
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:

View File

@ -8,18 +8,22 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CPT_Terrain_02
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Shader: {fileID: 4800000, guid: bee44b4a58655ee4cbff107302a3e131, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _SPECULAR_SETUP
m_InvalidKeywords: []
- DR_GRADIENT_ON
- DR_OUTLINE_ON
- _CELPRIMARYMODE_SINGLE
- _DETAILMAPBLENDINGMODE_MULTIPLY
- _TEXTUREBLENDINGMODE_MULTIPLY
m_InvalidKeywords:
- _UNITYSHADOWMODE_NONE
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:

View File

@ -192,7 +192,7 @@ Material:
- _ColorDimCurve: {r: 0.85023, g: 0.85034, b: 0.8504499, a: 0.85056}
- _ColorDimExtra: {r: 0.85023, g: 0.85034, b: 0.8504499, a: 0.85056}
- _ColorDimSteps: {r: 0.85023, g: 0.85034, b: 0.8504499, a: 0.85056}
- _ColorGradient: {r: 0.254717, g: 0.254717, b: 0.254717, a: 1}
- _ColorGradient: {r: 0.26063618, g: 0.16180134, b: 0.33962262, a: 1}
- _DetailMapColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _FlatRimColor: {r: 0.85023, g: 0.85034, b: 0.85045, a: 0.85056}

View File

@ -8,18 +8,22 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ice_01
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Shader: {fileID: 4800000, guid: bee44b4a58655ee4cbff107302a3e131, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _SPECULAR_SETUP
m_InvalidKeywords: []
- DR_GRADIENT_ON
- DR_OUTLINE_ON
- _CELPRIMARYMODE_SINGLE
- _DETAILMAPBLENDINGMODE_MULTIPLY
- _TEXTUREBLENDINGMODE_MULTIPLY
m_InvalidKeywords:
- _UNITYSHADOWMODE_NONE
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:

View File

@ -809,7 +809,7 @@ PlayerSettings:
PS5: UNITY_POST_PROCESSING_STACK_V2;INPUT_SYSTEM_PACKAGE
QNX: UNITY_POST_PROCESSING_STACK_V2;INPUT_SYSTEM_PACKAGE
Stadia: UNITY_POST_PROCESSING_STACK_V2;INPUT_SYSTEM_PACKAGE
Standalone: CROSS_PLATFORM_INPUT;UNITY_POST_PROCESSING_STACK_V2;NWH_DWP2;CREST_OCEAN;DWP_CREST;ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;INPUT_SYSTEM_PACKAGE;MOREMOUNTAINS_NICEVIBRATIONS_INSTALLED
Standalone: CROSS_PLATFORM_INPUT;UNITY_POST_PROCESSING_STACK_V2;NWH_DWP2;CREST_OCEAN;DWP_CREST;ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;INPUT_SYSTEM_PACKAGE;MOREMOUNTAINS_NICEVIBRATIONS_INSTALLED;ODIN_INSPECTOR_EDITOR_ONLY
VisionOS: UNITY_POST_PROCESSING_STACK_V2;INPUT_SYSTEM_PACKAGE
WebGL: UNITY_POST_PROCESSING_STACK_V2;INPUT_SYSTEM_PACKAGE
Windows Store Apps: UNITY_POST_PROCESSING_STACK_V2;INPUT_SYSTEM_PACKAGE