2026-04-23 자잘한 버그 수정
This commit is contained in:
6
Assets/02_Scripts/ITransPossible.cs
Normal file
6
Assets/02_Scripts/ITransPossible.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
public interface ITransScenePossible
|
||||
{
|
||||
public void OnSceneLoaded();
|
||||
}
|
||||
2
Assets/02_Scripts/ITransPossible.cs.meta
Normal file
2
Assets/02_Scripts/ITransPossible.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11e9ee061937f074a9f21ae44c697eb3
|
||||
@@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class SceneLoadManager : MonoBehaviour
|
||||
{
|
||||
public static SceneLoadManager Instance;
|
||||
@@ -30,6 +28,7 @@ private void Awake()
|
||||
private void Start()
|
||||
{
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
OnSceneLoaded(SceneManager.GetActiveScene(), LoadSceneMode.Single);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -41,10 +40,23 @@ private void Update()
|
||||
}
|
||||
}
|
||||
|
||||
//씬이 로드되었을때 호출
|
||||
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
{
|
||||
// 씬이 로드될 때마다
|
||||
|
||||
Debug.Log("씬 로드됨");
|
||||
|
||||
if(scene.name == "GameScene")
|
||||
{
|
||||
MonoBehaviour[] allObjs = UnityEngine.Object.FindObjectsByType<MonoBehaviour>(FindObjectsSortMode.None);
|
||||
|
||||
foreach (var obj in allObjs)
|
||||
{
|
||||
if (obj is ITransScenePossible itsp)
|
||||
{
|
||||
itsp.OnSceneLoaded();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Awaitable FadeLoadingCanvas(bool isOut,float fadeTime)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
using VRShopping.UI;
|
||||
|
||||
public class PlayerController : MonoBehaviour
|
||||
public class PlayerController : MonoBehaviour,ITransScenePossible
|
||||
{
|
||||
private Animator _anim;
|
||||
|
||||
@@ -16,6 +16,11 @@ private void Awake()
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnSceneLoaded()
|
||||
{
|
||||
InputManager.Instance.XRLeftControllerPrimaryButton_Event += this.ToggleShoppingOrderList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user