|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using SiegeSong;
|
|
|
|
|
using Gaia;
|
|
|
|
|
|
|
|
|
|
namespace SiegeSong
|
|
|
|
|
{
|
|
|
|
|
public class RuntimeManager : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public GameObject PlayerInstance;
|
|
|
|
|
public GaiaScenePlayer GaiaPlayer;
|
|
|
|
|
public GaiaGlobal GaiaGlobalSettings;
|
|
|
|
|
public Suimono.Core.SuimonoObject WaterSurface;
|
|
|
|
|
public Suimono.Core.SuimonoModule WaterModule;
|
|
|
|
|
//public EnviroSky EnviroSky;
|
|
|
|
|
public Calendar Calendar;
|
|
|
|
|
|
|
|
|
|
public void PopulateReferences()
|
|
|
|
|
{
|
|
|
|
|
if (EnviroSkyMgr.instance != null)
|
|
|
|
|
{
|
|
|
|
|
EnviroSkyMgr.instance.Player = PlayerInstance;
|
|
|
|
|
EnviroSkyMgr.instance.Camera = GetComponent<Camera>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GaiaPlayer != null)
|
|
|
|
|
{
|
|
|
|
|
GaiaPlayer.transform.parent = PlayerInstance.transform;
|
|
|
|
|
GaiaPlayer.transform.position = Vector3.zero;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (PlayerInstance.GetComponentInChildren<CameraManager>() != null
|
|
|
|
|
&& PlayerInstance.GetComponentInChildren<CameraManager>().ActiveCamera != null
|
|
|
|
|
&& PlayerInstance.GetComponentInChildren<CameraManager>().ActiveCamera.transform.childCount > 0)
|
|
|
|
|
{
|
|
|
|
|
var cameraGameObject = PlayerInstance.GetComponentInChildren<CameraManager>().ActiveCamera.transform.GetChild(0);
|
|
|
|
|
var camera = PlayerInstance.GetComponentInChildren<CameraManager>().ActiveCamera.GetComponentInChildren<Camera>();
|
|
|
|
|
if (WaterModule != null)
|
|
|
|
|
{
|
|
|
|
|
WaterModule.setCamera = PlayerInstance.GetComponentInChildren<CameraManager>().ActiveCamera.transform.GetChild(0);
|
|
|
|
|
WaterModule.mainCamera = PlayerInstance.GetComponentInChildren<CameraManager>().ActiveCamera.transform.GetChild(0);
|
|
|
|
|
WaterModule.manualCamera = PlayerInstance.GetComponentInChildren<CameraManager>().ActiveCamera.transform.GetChild(0);
|
|
|
|
|
WaterModule.setTrack = PlayerInstance.transform;
|
|
|
|
|
WaterModule.playSounds = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GaiaGlobalSettings != null)
|
|
|
|
|
GaiaGlobalSettings.m_mainCamera = PlayerInstance.GetComponentInChildren<CameraManager>().ActiveCamera.GetComponentInChildren<Camera>();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void DePopulateReferences()
|
|
|
|
|
{
|
|
|
|
|
if (EnviroSkyMgr.instance != null)
|
|
|
|
|
{
|
|
|
|
|
EnviroSkyMgr.instance.Player = null;
|
|
|
|
|
EnviroSkyMgr.instance.Camera = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GaiaPlayer != null)
|
|
|
|
|
GaiaPlayer = null;
|
|
|
|
|
|
|
|
|
|
if (WaterModule != null)
|
|
|
|
|
{
|
|
|
|
|
WaterModule.setCamera = null;
|
|
|
|
|
WaterModule.mainCamera = null;
|
|
|
|
|
WaterModule.manualCamera = null;
|
|
|
|
|
WaterModule.setTrack = null;
|
|
|
|
|
WaterModule.playSounds = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GaiaGlobalSettings.m_mainCamera = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Start() { }
|
|
|
|
|
|
|
|
|
|
void Update() { }
|
|
|
|
|
}
|
|
|
|
|
}
|