채팅 예제에 있는거 걍 갖다붙여서 사용하는데요
using BackEnd;
using UnityEngine;
public class GameManager2 : MonoBehaviour
{
public Camera MainCamera = null;
public GameObject LoginPopup = null;
public GameObject ChatPopup = null;
private float _Time = 0.0f;
private float _TimeRemaining = 3.0f;
private static GameManager2 _Instance = null;
public static GameManager2 Instance
{
get
{
if (_Instance == null)
{
_Instance = FindObjectOfType<GameManager2>();
}
return _Instance;
}
}
void Awake()
{
Application.targetFrameRate = 60;
Application.runInBackground = true;
Screen.sleepTimeout = SleepTimeout.NeverSleep;
/*
Rect rect = MainCamera.rect;
float scaleheight = ((float)Screen.width / Screen.height) / ((float)16 / 9);
float scalewidth = 1f / scaleheight;
if (scaleheight < 1)
{
rect.height = scaleheight;
rect.y = (1f - scaleheight) / 2f;
}
else
{
rect.width = scalewidth;
rect.x = (1f - scalewidth) / 2f;
}
MainCamera.rect = rect;
*/
ChatPopup.SetActive(false);
Backend.Initialize();
#if UNITY_ANDROID
Debug.Log("구글 해시 : " + Backend.Utils.GetGoogleHash());
#endif
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
_Time += Time.deltaTime;
if (_Time > _TimeRemaining)
{
_Time = 0.0f;
}
}
public void StartBackendChat()
{
LoginPopup.SetActive(false);
ChatPopup.SetActive(true);
}
}
이 부분 예제에 있는거 썼는데요.
Application.runInBackground = true;
Screen.sleepTimeout = SleepTimeout.NeverSleep;
이거를 써도 홈버튼 누르고 다시들어오면 채팅 끊겨있어요
안끊기게 어떻게 해요?