add more stuff

This commit is contained in:
Mister_Nebula 2020-11-02 22:15:46 +00:00
parent 26cb99592c
commit cea3688e74
3 changed files with 25 additions and 4 deletions

View File

@ -12,7 +12,7 @@ namespace QSB.Instruments
ESKER,
FELDSPAR,
GABBRO,
REIBECK,
RIEBECK,
SOLANUM
}
}

View File

@ -1,5 +1,6 @@
using QSB.Events;
using QSB.Instruments.QSBCamera;
using QSB.Utility;
using UnityEngine;
namespace QSB.Instruments
@ -7,11 +8,28 @@ namespace QSB.Instruments
public class InstrumentsManager : MonoBehaviour
{
public static InstrumentsManager Instance;
private RuntimeAnimatorController RiebeckController;
private RuntimeAnimatorController ChertController;
private RuntimeAnimatorController GabbroController;
private RuntimeAnimatorController FeldsparController;
private void Awake()
{
Instance = this;
gameObject.AddComponent<CameraManager>();
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
}
private void OnSceneLoaded(OWScene scene, bool inUniverse)
{
var reibeckRoot = GameObject.Find("Traveller_HEA_Riebeck_ANIM_Talking");
RiebeckController = reibeckRoot.GetComponent<Animator>().runtimeAnimatorController;
var chertRoot = GameObject.Find("Traveller_HEA_Chert_ANIM_Chatter_Chipper");
ChertController = chertRoot.GetComponent<Animator>().runtimeAnimatorController;
var gabbroRoot = GameObject.Find("Traveller_HEA_Gabbro_ANIM_IdleFlute");
GabbroController = gabbroRoot.GetComponent<Animator>().runtimeAnimatorController;
var feldsparRoot = GameObject.Find("Traveller_HEA_Feldspar_ANIM_Talking");
FeldsparController = feldsparRoot.GetComponent<Animator>().runtimeAnimatorController;
}
private void Update()
@ -21,7 +39,10 @@ namespace QSB.Instruments
if (!PlayerRegistry.LocalPlayer.PlayingInstrument)
{
CameraManager.Instance.SwitchTo3rdPerson();
SwitchToInstrument(InstrumentType.REIBECK);
SwitchToInstrument(InstrumentType.RIEBECK);
var animator = Locator.GetPlayerTransform().Find("Traveller_HEA_Player_v2").GetComponent<Animator>();
animator.runtimeAnimatorController = ChertController;
animator.SetTrigger("Playing");
}
else
{

View File

@ -10,9 +10,9 @@ namespace QSB.Instruments.QSBCamera
private Quaternion _rotationY;
// How far along the ray to move the camera. Avoids clipping into the walls.
private const float PercentToMove = 0.75f;
private const float PercentToMove = 0.80f;
// Maximum distance for camera clipping
private const float RayLength = 10f;
private const float RayLength = 5f;
public GameObject CameraObject;