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.
60 lines
2.7 KiB
C#
60 lines
2.7 KiB
C#
|
4 years ago
|
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;
|
||
|
|
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
GaiaGlobalSettings.m_mainCamera = PlayerInstance.GetComponentInChildren<CameraManager>().ActiveCamera.GetComponentInChildren<Camera>();
|
||
|
|
EnviroSky.PlayerCamera = camera;
|
||
|
|
EnviroSky.Player = PlayerInstance;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// This will toggled the active state of anything that causes errors when the Runtime Manager doesn't have an Actor Instance for the Player, such as before Starting or Loading a save file (in the start menu)
|
||
|
|
public void SetVolatileReferencesActiveState(bool active)
|
||
|
|
{
|
||
|
|
WaterModule.gameObject.active = active;
|
||
|
|
WaterSurface.gameObject.active = active;
|
||
|
|
}
|
||
|
|
|
||
|
|
void Start() { }
|
||
|
|
|
||
|
|
void Update() { }
|
||
|
|
}
|
||
|
|
}
|