로딩 추가했습니다.

카메라가 캐릭터 따라가는 부분 제거했습니다.
농장에서 ui가 나오지 않는 버그 수정했습니다.
This commit is contained in:
Ino 2025-03-04 16:30:03 +09:00
parent dbc0fcfa6c
commit 518363365c
11 changed files with 136 additions and 111 deletions

Binary file not shown.

View File

@ -613,7 +613,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_localtextKey: 19
--- !u!1 &247898931491393337
--- !u!1 &259718422659395581
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -621,54 +621,53 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3285573486048392709}
- component: {fileID: 115772543002549774}
- component: {fileID: 6630660901344196718}
- component: {fileID: 6414693691979496877}
m_Layer: 0
m_Name: New Image
- component: {fileID: 2535978644607196949}
- component: {fileID: 5449758688313156393}
- component: {fileID: 560264563046753084}
m_Layer: 5
m_Name: New TMP
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3285573486048392709
--- !u!224 &2535978644607196949
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 247898931491393337}
m_GameObject: {fileID: 259718422659395581}
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: 1413665509564070125}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 360}
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: 100, y: 100}
m_SizeDelta: {x: 150, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &115772543002549774
--- !u!222 &5449758688313156393
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 247898931491393337}
m_GameObject: {fileID: 259718422659395581}
m_CullTransparentMesh: 1
--- !u!114 &6630660901344196718
--- !u!114 &560264563046753084
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 247898931491393337}
m_GameObject: {fileID: 259718422659395581}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
@ -679,32 +678,76 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 1c9bfa275b8c92544b3d4a09202d88ef, 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!111 &6414693691979496877
Animation:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 247898931491393337}
m_Enabled: 1
serializedVersion: 3
m_Animation: {fileID: 7400000, guid: 312eacd722ab4af4fa0134342e97216d, type: 2}
m_Animations:
- {fileID: 7400000, guid: 312eacd722ab4af4fa0134342e97216d, type: 2}
m_WrapMode: 0
m_PlayAutomatically: 1
m_AnimatePhysics: 0
m_CullingType: 0
m_text: Loading...
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: a387e325271126742ad15569dba1ac57, type: 2}
m_sharedMaterial: {fileID: -6459762427321423278, guid: a387e325271126742ad15569dba1ac57,
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: 20
m_fontSizeBase: 20
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 10
m_fontSizeMax: 40
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 4096
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &477398187380938062
GameObject:
m_ObjectHideFlags: 0
@ -4611,7 +4654,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
go: {fileID: 8337823033090345085}
sprite_bg: {fileID: 4452635937245129058}
m_text: {fileID: 560264563046753084}
--- !u!1 &4137797186450993593
GameObject:
m_ObjectHideFlags: 0
@ -8835,7 +8878,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.39215687}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@ -10931,7 +10974,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1637126672312165090}
- {fileID: 3285573486048392709}
- {fileID: 2535978644607196949}
m_Father: {fileID: 3014764382062236013}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}

View File

@ -10678,7 +10678,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5a7e49710ad54b743bead07336d94e8e, type: 3}
m_Name:
m_EditorClassIdentifier:
go_Camera: {fileID: 0}
dungeonResults:
- {fileID: 7654730528903163442}
- {fileID: 7547394924440565505}
@ -49963,7 +49962,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9522d62ea22f25d468bea7fbe90eab95, type: 3}
m_Name:
m_EditorClassIdentifier:
go_Camera: {fileID: 0}
go_child: {fileID: 4319977179521341279}
go_boss: {fileID: 4266606170441426330}
sprites:
@ -61277,7 +61275,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: cec67716a6d2a0b45af2ea4686ca3df9, type: 3}
m_Name:
m_EditorClassIdentifier:
go_Camera: {fileID: 0}
m_RankingUI: {fileID: 8875568081737074834}
--- !u!1 &4944573237779459871
GameObject:
@ -62797,7 +62794,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4e19f7b72b79d6247959b21daaaab8d6, type: 3}
m_Name:
m_EditorClassIdentifier:
go_Camera: {fileID: 0}
rtf_onoff: {fileID: 5628033596425043958}
rtf_layout: {fileID: 4546882025923078743}
m_layout: {fileID: 6073836825621844675}
@ -62891,7 +62887,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d37ecd17824c5d5448e1205878bd5ccc, type: 3}
m_Name:
m_EditorClassIdentifier:
go_Camera: {fileID: 0}
images:
- {fileID: 6055483947737236977}
texts:
@ -68950,7 +68945,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 53376fb6fb9a52c4f96a5fa681009331, type: 3}
m_Name:
m_EditorClassIdentifier:
go_Camera: {fileID: 0}
m_EquipmentItemPopup: {fileID: 3045496747550351632}
m_EquipmentPopup: {fileID: 2424877493288058929}
m_EquipmentMakePopup: {fileID: 5551366820280862753}
@ -106101,7 +106095,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b85e1d85665b0be4e83a7fcfd35f75ca, type: 3}
m_Name:
m_EditorClassIdentifier:
go_Camera: {fileID: 699737578772148232}
UICamera: {fileID: 8894278689083431117}
gos:
- {fileID: 7572678700870248663}
- {fileID: 1094987121034510843}
@ -106480,7 +106474,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1f45775da10f7e54b9ed54431667c759, type: 3}
m_Name:
m_EditorClassIdentifier:
go_Camera: {fileID: 0}
go_child: {fileID: 6654041026865147712}
label_statchange: {fileID: 5870361847762626685}
--- !u!1 &8846055359537270381
@ -110433,7 +110426,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d37ecd17824c5d5448e1205878bd5ccc, type: 3}
m_Name:
m_EditorClassIdentifier:
go_Camera: {fileID: 0}
images:
- {fileID: 7547153118397443468}
texts:

View File

@ -10,6 +10,7 @@ public class SaveNPCToolTip : MonoBehaviour
{
var follow = GetComponent<UIFollowTarget_Ino>();
follow.target = _target;
follow.isTarget = follow.target;
follow.offSet = Vector3.up * 70f;
follow.runUpdate = true;
}

View File

@ -11,11 +11,9 @@ public class SceneInfo : MonoBehaviour
{
if (CurStageData == null)
{ // 최초 로드
LoadingUI.Ins.Set(true, () =>
{
CurStageData = _stagedata;
StartCoroutine(Co_Control_AddScene(_stagedata, true, addloadend));
});
LoadingUI.Ins.Start_Loading();
CurStageData = _stagedata;
StartCoroutine(Co_Control_AddScene(_stagedata, true, addloadend));
}
else if (CurStageData.s_Scene.Equals(_stagedata.s_Scene))
{ // 같은 맵
@ -23,12 +21,10 @@ public class SceneInfo : MonoBehaviour
}
else
{ // 다른 씬
LoadingUI.Ins.Set(true, () =>
{
StartCoroutine(Co_Control_AddScene(_stagedata, false, addloadend));
CurStageData = _stagedata;
StartCoroutine(Co_Control_AddScene(_stagedata, true, addloadend));
});
LoadingUI.Ins.Start_Loading();
StartCoroutine(Co_Control_AddScene(_stagedata, false, addloadend));
CurStageData = _stagedata;
StartCoroutine(Co_Control_AddScene(_stagedata, true, addloadend));
}
}
@ -60,7 +56,10 @@ public class SceneInfo : MonoBehaviour
// }
//}
}
LoadingUI.Ins.Set(false);
yield return new WaitForSeconds(1f);
LoadingUI.Ins.End_Loading();
SoundInfo.Ins.Play_BGM(DSUtil.StringToEnum<eBGM>(CurStageData.s_BGM));
addloadend?.Invoke();
Debug.Log(DSUtil.StopStopWatch(false));

View File

@ -1,40 +1,35 @@
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class LoadingUI : MyCoroutine
{
public static LoadingUI Ins;
public GameObject go;
public Image sprite_bg;
public TextMeshProUGUI m_text;
private string baseText = "Loading";
private int dotCount = 0;
void Awake()
void Awake() { Ins = this; }
public void Start_Loading()
{
Ins = this;
go.SetActive(true);
StartCoroutine(AnimateLoadingText());
}
public void Set(bool _active, Action _act = null)
public void End_Loading()
{
if (_active)
{
sprite_bg.canvasRenderer.SetAlpha(1f);
go.SetActive(_active);
Set_Coroutine(_act, 0.5f);
}
else
StartCoroutine(Co_Alpha());
}
IEnumerator Co_Alpha()
{
while (sprite_bg.canvasRenderer.GetAlpha() > 0f)
{
var alpha = sprite_bg.canvasRenderer.GetAlpha();
sprite_bg.canvasRenderer.SetAlpha(alpha - Time.deltaTime * 0.5f);
yield return null;
}
go.SetActive(false);
}
IEnumerator AnimateLoadingText()
{
while (true)
{
m_text.text = baseText + new string('.', dotCount);
dotCount = (dotCount + 1) % 4; // 0 → 1 → 2 → 3 → 0 순환
yield return new WaitForSeconds(0.5f); // 0.5초 간격으로 변경
}
}
}

View File

@ -297,7 +297,7 @@ public class GameUI : MonoBehaviourSingletonTemplate<GameUI>
DSUtil.InActivateGameObjects(gos_myfarm);
DSUtil.ActivateGameObjects(gos_lobby);
//if (MessageInfo.Ins) MessageInfo.Ins.go_Small.transform.localPosition = new Vector3(436f, 139f);
go_Camera.GetComponent<UICamera>().allowMultiTouch = UICamera.first.allowMultiTouch = false;
//go_Camera.GetComponent<UICamera>().allowMultiTouch = UICamera.first.allowMultiTouch = false;
if (SleepMode.IsActive) OptionInfo.Ins.m_SleepMode.Set();
if (GlobalVolumeMgr.isIns) GlobalVolumeMgr.Ins.Set(0);
break;
@ -306,14 +306,14 @@ public class GameUI : MonoBehaviourSingletonTemplate<GameUI>
DSUtil.InActivateGameObjects(gos_myfarm);
DSUtil.ActivateGameObjects(gos_ingame);
//if (MessageInfo.Ins) MessageInfo.Ins.go_Small.transform.localPosition = new Vector3(436f, 44f);
go_Camera.GetComponent<UICamera>().allowMultiTouch = UICamera.first.allowMultiTouch = true;
//go_Camera.GetComponent<UICamera>().allowMultiTouch = UICamera.first.allowMultiTouch = true;
break;
case eGameMode.MyFarm:
DSUtil.InActivateGameObjects(gos_lobby);
DSUtil.InActivateGameObjects(gos_ingame);
DSUtil.ActivateGameObjects(gos_myfarm);
//if (MessageInfo.Ins) MessageInfo.Ins.go_Small.transform.localPosition = new Vector3(436f, 44f);
go_Camera.GetComponent<UICamera>().allowMultiTouch = UICamera.first.allowMultiTouch = false;
//go_Camera.GetComponent<UICamera>().allowMultiTouch = UICamera.first.allowMultiTouch = false;
break;
}
}

View File

@ -4,6 +4,7 @@ using UnityEngine.Rendering.Universal;
public class NewGameUI : MonoBehaviourSingletonTemplate<NewGameUI>
{
public Camera UICamera;
public GameObject[] gos; // 0 공용 ui, 1 로비 ui들, 2 인게임 ui들, 3 농장 ui들
public GameObject[] gos_ingame; // 0 스테이지, 1 던전
public Ingame_Dungeon ingame_dungeon;
@ -29,7 +30,7 @@ public class NewGameUI : MonoBehaviourSingletonTemplate<NewGameUI>
m_GuideQuestUI.Set();
InGameInfo.Ins.Load_Map(-1);
var cameraData = Camera.main.GetUniversalAdditionalCameraData();
cameraData.cameraStack.Add(go_Camera.GetComponent<Camera>());
cameraData.cameraStack.Add(UICamera);
}
#if UNITY_EDITOR
@ -68,7 +69,6 @@ public class NewGameUI : MonoBehaviourSingletonTemplate<NewGameUI>
}
m_BattleUI.Set(eUICardType.Use, ServerInfo.Ins.m_ServerData.Equip.Preset);
go_Camera.SetActive(false);
}
public void Refresh_DungeonUI(int addmob = 0)
{

View File

@ -6,12 +6,9 @@ public class MonoBehaviourSingletonTemplate<T> : MonoBehaviour where T : MonoBeh
{
public static T Ins;
public static bool isIns;
public GameObject go_Camera;
protected virtual void Awake() { Ins = this as T; isIns = true; }
protected void DontDestroy() { DontDestroyOnLoad(gameObject); }
public void Camera_On() { if (go_Camera) go_Camera.SetActive(true); }
public void Camera_Off() { if (go_Camera) go_Camera.SetActive(false); }
}
public class MonoBehaviourSingletonScrollViewMgr<T> : ScrollViewMgr where T : MonoBehaviour

View File

@ -1,6 +1,5 @@
using System.Collections.Generic;
using UnityEngine;
using static UnityEngine.GraphicsBuffer;
public class RealCamera : MyCoroutine
{
@ -63,8 +62,6 @@ public class RealCamera : MyCoroutine
Add_CamActionTarget(_target);
}
rotateAround = _camrot;
//cameraHeight = 55f;
Set_DistanceUp(false);
VerticalAxis = maxDistance = OrimaxDistance;
}
@ -161,7 +158,8 @@ public class RealCamera : MyCoroutine
Vector3 rotateVector = rotation * vectorMask;
DistanceAway = Mathf.Clamp(DistanceAway += VerticalAxis, minDistance, maxDistance);
camPosition = targetOffset + Vector3.up * DistanceUp - rotateVector * DistanceAway;
transform.position = Vector3.Lerp(transform.position, camPosition, Time.deltaTime * 2.5f);
//transform.position = Vector3.Lerp(transform.position, camPosition, Time.deltaTime * 2.5f);
transform.position = Vector3.Lerp(transform.position, camPosition, 1f); // 즉시 이동
if (Vector3.Distance(transform.position, camPosition) < 0.05f)
{
@ -175,17 +173,11 @@ public class RealCamera : MyCoroutine
}
else if (CamStatus == 1)
Update_Cam();
// 이전 위치 업데이트
previousPosition = target.position;
}
private Vector3 previousPosition; // 이전 프레임에서 캐릭터의 위치를 저장할 변수
public float rotationSpeed = 1.25f; // 카메라 회전 속도 조절 변수
void Start_Game()
{
ActorInfo.Ins.All_Stop(false);
NewGameUI.Ins.go_Camera.SetActive(true);
Time.timeScale = MyValue.Get_GameSpeed();
DungeonInfo.Ins.Start_Dungeon(true);
}

View File

@ -6,6 +6,7 @@ public class UIFollowTarget_Ino : MonoBehaviour
/// 3D target that this object will be positioned above.
/// </summary>
public Transform target;
public bool isTarget;
/// <summary>
/// UI 위치 오프셋, z는 0
@ -16,6 +17,7 @@ public class UIFollowTarget_Ino : MonoBehaviour
/// UI camera to use.
/// </summary>
public Camera uiCamera;
bool isUICam;
Transform mTrans;
int mIsVisible = -1;
@ -41,8 +43,12 @@ public class UIFollowTarget_Ino : MonoBehaviour
{
if (runUpdate)
{
if (uiCamera == null) uiCamera = GameUI.Ins.go_Camera.GetComponent<Camera>();
if (target && uiCamera != null)
if (!isUICam)
{
uiCamera = NewGameUI.Ins.UICamera;
isUICam = uiCamera;
}
if (isTarget && isUICam)
{
Vector3 pos = Camera.main.WorldToViewportPoint(target.position);