maint: created new scene for demoing. cleaned up errors.
This commit is contained in:
25
Assets/Scripts/Core/GameManager.cs
Normal file
25
Assets/Scripts/Core/GameManager.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reset{
|
||||
public static class GameManager{
|
||||
public static GameObject UI;
|
||||
public static GameObject Camera;
|
||||
public static GameObject Input;
|
||||
|
||||
[RuntimeInitializeOnLoadMethodAttribute]
|
||||
static void PopulateSceneReferences(){
|
||||
try {
|
||||
UI = GameObject.Find("UICanvas");
|
||||
Camera = GameObject.Find("CameraGroup");
|
||||
Input = GameObject.Find("InputManager");
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine(e);
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Core/GameManager.cs.meta
Normal file
2
Assets/Scripts/Core/GameManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4177414f9e5aa034986c58a118aeb2d7
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using Reset;
|
||||
using Sirenix.OdinInspector;
|
||||
using Unity.Cinemachine;
|
||||
using UnityEngine;
|
||||
@@ -52,6 +53,14 @@ public class LockOnManager : MonoBehaviour{
|
||||
this.enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// References from camera
|
||||
targetGroup = GameManager.Camera.transform.Find("Target Group").GetComponent<CinemachineTargetGroup>();
|
||||
lockOnDocument = GameManager.UI.transform.Find("Lock On").GetComponent<UIDocument>();
|
||||
|
||||
// Set the camera's target as the player
|
||||
targetGroup.Targets.Add(new CinemachineTargetGroup.Target{Object = transform, Radius = 3.5f, Weight = 1f});
|
||||
GameManager.Camera.transform.Find("Cinemachine").GetComponent<CinemachineCamera>().Target.TrackingTarget = transform;
|
||||
|
||||
// Quick check for things in lock-on target that aren't lock-onable
|
||||
if (mainTarget != null && mainTarget.gameObject.GetComponent<ILockOnTarget>() == null) {
|
||||
|
||||
@@ -49,10 +49,15 @@ namespace Reset.Core.Tools{
|
||||
Destroy(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
void Start(){
|
||||
canvasRootGameObject = GameManager.UI;
|
||||
root = canvasRootGameObject.transform.Find("Debug Overlay").GetComponent<UIDocument>();
|
||||
|
||||
SetCurrentPageVisible();
|
||||
|
||||
Debug.Log(valueTemplate.Instantiate().resolvedStyle.backgroundColor);
|
||||
|
||||
Reference in New Issue
Block a user