[Update] 로직 변경 및 회전 문제 해결 등
1. 회전 시 펜스가 사라지거나 남았던 현상 해결 - 펜스의 LOD가 여러개여서 필요한것만 남기고 삭제 2. 실드 ui 조정 - 별도의 스크립트와 핸들러를 이용해 빈 오브젝트(앵커)에 소속하게 변경 - pc에서는 화면 우측 상단으로 이동 - 모바일에서는 버튼 안으로 이동 3. 폰트 변경
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91784ccc61e72a1438408f8d8e1f14fa
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b0ab2ff66a1835946824e95201e30a87
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8fe25cc68a5346a41a49b5c8086a55ce
|
||||
TrueTypeFontImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 0
|
||||
characterPadding: 1
|
||||
includeFontData: 1
|
||||
fontNames:
|
||||
- Continuous
|
||||
fallbackFontReferences: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
ascentCalculationMode: 1
|
||||
useLegacyBoundsCalculation: 0
|
||||
shouldRoundAdvanceValue: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72a10f36af3cd1f418f57563e3ed0758
|
||||
TrueTypeFontImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 0
|
||||
characterPadding: 1
|
||||
includeFontData: 1
|
||||
fontNames:
|
||||
- Continuous
|
||||
fallbackFontReferences: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
ascentCalculationMode: 1
|
||||
useLegacyBoundsCalculation: 0
|
||||
shouldRoundAdvanceValue: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,245 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3427343580306066410
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5552384751827164157}
|
||||
- component: {fileID: 4125202108841865504}
|
||||
- component: {fileID: 666934295257854995}
|
||||
m_Layer: 5
|
||||
m_Name: shiledCount
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5552384751827164157
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3427343580306066410}
|
||||
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: 6611400751311966178}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 200, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4125202108841865504
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3427343580306066410}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &666934295257854995
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3427343580306066410}
|
||||
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:
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 36
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_characterHorizontalScale: 1
|
||||
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!1 &8339315473958554171
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6611400751311966178}
|
||||
- component: {fileID: 5457160099985147756}
|
||||
- component: {fileID: 4781576029911910886}
|
||||
- component: {fileID: 3707644374494363473}
|
||||
- component: {fileID: -6351126992494556073}
|
||||
m_Layer: 5
|
||||
m_Name: Shiled
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6611400751311966178
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8339315473958554171}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 8.11719}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 5552384751827164157}
|
||||
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: -5.1990967, y: 0}
|
||||
m_SizeDelta: {x: 130, y: 130}
|
||||
m_Pivot: {x: 1, y: 0}
|
||||
--- !u!222 &5457160099985147756
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8339315473958554171}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &4781576029911910886
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8339315473958554171}
|
||||
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: 21300000, guid: 5defaa032c8a7484cab0ce3d3e70b7d5, 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 &3707644374494363473
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8339315473958554171}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b245920762fd34b488c890ebe44abdd5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::ShieldUIHandler
|
||||
shieldIcon: {fileID: 4781576029911910886}
|
||||
countText: {fileID: 666934295257854995}
|
||||
--- !u!114 &-6351126992494556073
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8339315473958554171}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a581d3c527475634d98e2afd54a74f85, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::ShieldRelocator
|
||||
pcAnchor: {fileID: 0}
|
||||
mobileAnchor: {fileID: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72adbafc931314d45948a23f91f44177
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+11610
-830
File diff suppressed because one or more lines are too long
@@ -47,16 +47,17 @@ public class NewMonoBehaviourScript : MonoBehaviour
|
||||
currentStep = step;
|
||||
switch (step)
|
||||
{
|
||||
case 1 :
|
||||
case 1:
|
||||
SetSpawnersActive(2);
|
||||
if (rotator != null) rotator.enabled = false;
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
case 2:
|
||||
SetSpawnersActive(4);
|
||||
if (rotator != null) rotator.enabled = false;
|
||||
break;
|
||||
|
||||
case 3 :
|
||||
case 3:
|
||||
SetSpawnersActive(4);
|
||||
if (rotator != null) rotator.enabled = true;
|
||||
break;
|
||||
|
||||
@@ -1,56 +1,46 @@
|
||||
using TMPro;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
|
||||
public class PlayerController : MonoBehaviour
|
||||
{
|
||||
private Rigidbody playerRigidbody;
|
||||
[Header("Movement")]
|
||||
public float speed = 8f;
|
||||
private Rigidbody playerRigidbody;
|
||||
public VirtualJoystick joystick;
|
||||
|
||||
[Header("Shield System")]
|
||||
public int shieldCount = 3;
|
||||
private bool isShieldActive = false;
|
||||
public GameObject shieldVisual;
|
||||
public Image shieldIcon;
|
||||
public TextMeshProUGUI countText;
|
||||
|
||||
// [추가] 조이스틱 연결용 변수
|
||||
public VirtualJoystick joystick;
|
||||
|
||||
public void Die()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
GameManager gm = FindFirstObjectByType<GameManager>();
|
||||
gm.EndGame();
|
||||
}
|
||||
public ShieldUIHandler shieldUI; // UI 전용 스크립트 참조
|
||||
|
||||
void Start()
|
||||
{
|
||||
playerRigidbody = GetComponent<Rigidbody>();
|
||||
|
||||
if (GameSettings.IsMobile)
|
||||
{
|
||||
if (shieldIcon != null) shieldIcon.gameObject.SetActive(false);
|
||||
if (countText != null) countText.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateShieldUI();
|
||||
}
|
||||
// 초기 UI 상태 반영
|
||||
if (shieldUI != null) shieldUI.UpdateShieldUI(shieldCount);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
float x = 0;
|
||||
float z = 0;
|
||||
HandleMovement();
|
||||
|
||||
// PC 입력 처리 (모바일 아닐 때만)
|
||||
if (!GameSettings.IsMobile && Input.GetKeyDown(KeyCode.Alpha1))
|
||||
{
|
||||
ActivateShieldLogic();
|
||||
}
|
||||
}
|
||||
|
||||
void HandleMovement()
|
||||
{
|
||||
float x = 0, z = 0;
|
||||
|
||||
// [수정] 플랫폼에 따라 입력 방식 분기
|
||||
if (GameSettings.IsMobile && joystick != null)
|
||||
{
|
||||
Vector2 input = joystick.GetInput();
|
||||
x = input.x;
|
||||
z = input.y;
|
||||
x = input.x; z = input.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -58,67 +48,44 @@ public class PlayerController : MonoBehaviour
|
||||
z = Input.GetAxis("Vertical");
|
||||
}
|
||||
|
||||
float xSpeed = x * speed;
|
||||
float zSpeed = z * speed;
|
||||
playerRigidbody.linearVelocity = new Vector3(x * speed, 0f, z * speed);
|
||||
|
||||
bool moveInput = (x != 0 || z != 0);
|
||||
|
||||
Vector3 newVelocity = new Vector3(xSpeed, 0f, zSpeed);
|
||||
playerRigidbody.linearVelocity = newVelocity;
|
||||
|
||||
if (moveInput)
|
||||
if (x != 0 || z != 0)
|
||||
{
|
||||
Vector3 moveDirection = new Vector3(x, 0f, z);
|
||||
Quaternion newRotation = Quaternion.LookRotation(moveDirection);
|
||||
transform.rotation = newRotation;
|
||||
}
|
||||
|
||||
// PC일 때만 키보드 실드 입력 허용
|
||||
if (!GameSettings.IsMobile && Input.GetKeyDown(KeyCode.Alpha1))
|
||||
{
|
||||
ActivateShieldLogic();
|
||||
transform.rotation = Quaternion.LookRotation(new Vector3(x, 0f, z));
|
||||
}
|
||||
|
||||
// 애니메이션
|
||||
Animator anim = GetComponentInChildren<Animator>();
|
||||
if (anim != null)
|
||||
{
|
||||
anim.SetBool("isMoving", moveInput);
|
||||
}
|
||||
if (anim != null) anim.SetBool("isMoving", (x != 0 || z != 0));
|
||||
}
|
||||
|
||||
public void ActivateShieldLogic()
|
||||
{
|
||||
if (shieldCount > 0 && !isShieldActive)
|
||||
{
|
||||
StartCoroutine(ActivateShield());
|
||||
StartCoroutine(ActivateShieldRoutine());
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateShieldUI()
|
||||
{
|
||||
if (countText != null)
|
||||
{
|
||||
countText.text = shieldCount.ToString();
|
||||
if (shieldCount <= 0)
|
||||
{
|
||||
countText.gameObject.SetActive(false);
|
||||
if (shieldIcon != null)
|
||||
{
|
||||
shieldIcon.color = new Color(0.2f, 0.2f, 0.2f, 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator ActivateShield()
|
||||
private IEnumerator ActivateShieldRoutine()
|
||||
{
|
||||
isShieldActive = true;
|
||||
shieldCount--;
|
||||
UpdateShieldUI();
|
||||
|
||||
// UI 업데이트 위임
|
||||
if (shieldUI != null) shieldUI.UpdateShieldUI(shieldCount);
|
||||
|
||||
if (shieldVisual != null) shieldVisual.SetActive(true);
|
||||
yield return new WaitForSeconds(2f);
|
||||
if (shieldVisual != null) shieldVisual.SetActive(false);
|
||||
|
||||
isShieldActive = false;
|
||||
}
|
||||
|
||||
public void Die()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
FindFirstObjectByType<GameManager>()?.EndGame();
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,6 @@ public class RestartTextHandler : MonoBehaviour
|
||||
if (GameSettings.IsMobile)
|
||||
restartText.text = "Touch the screen to restart";
|
||||
else
|
||||
restartText.text = "Press the R key to restart";
|
||||
restartText.text = "Press the 'R' key to restart";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ShieldRelocator : MonoBehaviour
|
||||
{
|
||||
public Transform pcAnchor; // PC 화면 위치
|
||||
public Transform mobileAnchor; // 모바일 버튼 내부 위치
|
||||
|
||||
void Awake()
|
||||
{
|
||||
bool isMobile = Application.isMobilePlatform;
|
||||
Transform targetParent = isMobile ? mobileAnchor : pcAnchor;
|
||||
|
||||
transform.SetParent(targetParent, false);
|
||||
|
||||
RectTransform rect = GetComponent<RectTransform>();
|
||||
|
||||
rect.pivot = new Vector2(0.5f, 0.5f);
|
||||
|
||||
rect.anchorMin = new Vector2(0.5f, 0.5f);
|
||||
rect.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
|
||||
rect.anchoredPosition = Vector2.zero;
|
||||
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a581d3c527475634d98e2afd54a74f85
|
||||
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
public class ShieldUIHandler : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Image shieldIcon;
|
||||
[SerializeField] private TextMeshProUGUI countText;
|
||||
|
||||
// UI 업데이트만 담당하는 함수
|
||||
public void UpdateShieldUI(int count)
|
||||
{
|
||||
if (countText != null)
|
||||
{
|
||||
countText.text = count.ToString();
|
||||
// 개수가 0이면 텍스트 숨기기
|
||||
countText.gameObject.SetActive(count > 0);
|
||||
}
|
||||
|
||||
if (shieldIcon != null)
|
||||
{
|
||||
// 색상 조절 로직
|
||||
shieldIcon.color = (count > 0) ? Color.white : new Color(0.2f, 0.2f, 0.2f, 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b245920762fd34b488c890ebe44abdd5
|
||||
@@ -342,6 +342,9 @@ MonoBehaviour:
|
||||
skyOcclusionIntensityMultiplier:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
worldOffset:
|
||||
m_OverrideState: 1
|
||||
m_Value: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &-1216621516061285780
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
@@ -376,6 +379,9 @@ MonoBehaviour:
|
||||
highQualityFiltering:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
filter:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
downscale:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
@@ -462,8 +468,6 @@ MonoBehaviour:
|
||||
- {fileID: -6288072647309666549}
|
||||
- {fileID: 7518938298396184218}
|
||||
- {fileID: -1410297666881709256}
|
||||
- {fileID: -7750755424749557576}
|
||||
- {fileID: -5139089513906902183}
|
||||
--- !u!114 &853819529557874667
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
|
||||
@@ -12,6 +12,8 @@ public class VirtualButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandl
|
||||
|
||||
public UnityEvent onClick;
|
||||
|
||||
public PlayerController playerController;
|
||||
|
||||
private bool rotate = false;
|
||||
|
||||
void FixedUpdate()
|
||||
@@ -30,6 +32,11 @@ public class VirtualButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandl
|
||||
rotate = true;
|
||||
|
||||
onClick?.Invoke();
|
||||
|
||||
if (playerController != null)
|
||||
{
|
||||
playerController.ActivateShieldLogic();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerUp(PointerEventData pointerEventData)
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"com.unity.ide.vscode": "1.2.3",
|
||||
"com.unity.inputsystem": "1.18.0",
|
||||
"com.unity.multiplayer.center": "1.0.1",
|
||||
"com.unity.probuilder": "6.0.9",
|
||||
"com.unity.render-pipelines.universal": "17.3.0",
|
||||
"com.unity.test-framework": "1.6.0",
|
||||
"com.unity.timeline": "1.8.10",
|
||||
|
||||
@@ -131,6 +131,18 @@
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.probuilder": {
|
||||
"version": "6.0.9",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.shadergraph": "17.0.3",
|
||||
"com.unity.modules.imgui": "1.0.0",
|
||||
"com.unity.modules.physics": "1.0.0",
|
||||
"com.unity.settings-manager": "1.0.3"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.render-pipelines.core": {
|
||||
"version": "17.3.0",
|
||||
"depth": 1,
|
||||
@@ -170,6 +182,13 @@
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.settings-manager": {
|
||||
"version": "2.1.1",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.shadergraph": {
|
||||
"version": "17.3.0",
|
||||
"depth": 1,
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
{
|
||||
"m_Dictionary": {
|
||||
"m_DictionaryValues": [
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.LogLevel, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "log.level",
|
||||
"value": "{\"m_Value\":3}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.LogOutput, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "log.output",
|
||||
"value": "{\"m_Value\":1}"
|
||||
},
|
||||
{
|
||||
"type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "log.path",
|
||||
"value": "{\"m_Value\":\"ProBuilderLog.txt\"}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "about.identifier",
|
||||
"value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":0,\"m_Patch\":9,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "preferences.version",
|
||||
"value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":0,\"m_Patch\":9,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "experimental.enabled",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "ShapeComponent.ResetSettings",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "ShapeComponent.SettingsEnabled",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "mesh.newShapesSnapToGrid",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "mesh.meshColliderIsConvex",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "lightmapping.autoUnwrapLightmapUV",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "editor.autoRecalculateCollisions",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "meshImporter.quads",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "meshImporter.smoothing",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "editor.autoUpdatePreview",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "editor.stripProBuilderScriptsOnBuild",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "ShapeBuilder.ActiveShapeIndex",
|
||||
"value": "{\"m_Value\":6}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.LastSize.Cube",
|
||||
"value": "{\"m_Value\":{\"x\":1.99513840675354,\"y\":-0.9618093371391296,\"z\":-12.994812965393067}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.LastRotation.Cube",
|
||||
"value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.SelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "s_SelectMode",
|
||||
"value": "{\"m_Value\":4}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.PivotLocation.Cube",
|
||||
"value": "{\"m_Value\":0}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Material, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.userMaterial",
|
||||
"value": "{\"m_Value\":{\"instanceID\":0}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Rendering.ShadowCastingMode, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.shadowCastingMode",
|
||||
"value": "{\"m_Value\":1}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEditor.StaticEditorFlags, UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.defaultStaticEditorFlags",
|
||||
"value": "{\"m_Value\":0}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.ColliderType, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.newShapeColliderType",
|
||||
"value": "{\"m_Value\":2}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.UnwrapParameters, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "lightmapping.defaultLightmapUnwrapParameters",
|
||||
"value": "{\"m_Value\":{\"m_HardAngle\":88.0,\"m_PackMargin\":20.0,\"m_AngleError\":8.0,\"m_AreaError\":15.0}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.Cube",
|
||||
"value": "{}"
|
||||
},
|
||||
{
|
||||
"type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "meshImporter.smoothingAngle",
|
||||
"value": "{\"m_Value\":0.00009999999747378752}"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user