You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
|
|
using UnityEngine;
|
|
using Cinemachine;
|
|
using StarterAssets;
|
|
using HGR.Core.Singletons;
|
|
using System.Threading.Tasks;
|
|
|
|
public class OfflineGameManager : Singleton<OfflineGameManager>
|
|
{
|
|
//===================================================
|
|
// FIELDS
|
|
//===================================================
|
|
[SerializeField] GameObject _offlineMale = null;
|
|
[SerializeField] GameObject _offlineFemale = null;
|
|
[SerializeField] CinemachineVirtualCamera _virtualCamPrefab = null;
|
|
[SerializeField] UICanvasControllerInput _mobileInput = null;
|
|
|
|
//===================================================
|
|
// PROPERTIES
|
|
//===================================================
|
|
public UICanvasControllerInput MobileInput => _mobileInput;
|
|
|
|
//===================================================
|
|
// METHODS
|
|
//===================================================
|
|
internal async override void Init()
|
|
{
|
|
base.Init();
|
|
await Task.Delay(1000);
|
|
|
|
if(GameManager.Instance)
|
|
{
|
|
_offlineMale.SetActive(GameManager.Instance.Gender == Gender.Male);
|
|
_offlineFemale.SetActive(GameManager.Instance.Gender == Gender.Female);
|
|
_virtualCamPrefab.m_Follow = GameManager.Instance.Gender == Gender.Male ? _offlineMale.transform : _offlineFemale.transform;
|
|
}//if end
|
|
else
|
|
{
|
|
_offlineMale.SetActive(true);
|
|
_offlineFemale.SetActive(false);
|
|
_virtualCamPrefab.m_Follow = _offlineMale.transform;
|
|
}//else end
|
|
|
|
}//Init() end
|
|
|
|
}//class end |