diff --git a/Assets/Scripts/Camera/Overseer/OverseerTarget.cs b/Assets/Scripts/Camera/Overseer/OverseerTarget.cs index c39b22b..e20743f 100644 --- a/Assets/Scripts/Camera/Overseer/OverseerTarget.cs +++ b/Assets/Scripts/Camera/Overseer/OverseerTarget.cs @@ -26,4 +26,11 @@ private void Awake() } } + private void Start() + { + if (!startTarget) + Debug.Log("Your scene needs an starting target for the Overseer to work OK"); + + } + } diff --git a/Assets/Scripts/Controls/OverSeer/OverseerControls.cs b/Assets/Scripts/Controls/OverSeer/OverseerControls.cs index 6ffe23f..605a947 100644 --- a/Assets/Scripts/Controls/OverSeer/OverseerControls.cs +++ b/Assets/Scripts/Controls/OverSeer/OverseerControls.cs @@ -4,6 +4,11 @@ public class OverseerControls : MonoBehaviour { + public static OverseerControls Instance; + private void Awake() + { + Instance = this; + } public string actionButtonX; public string actionButtonA; public string actionButtonB; @@ -16,7 +21,7 @@ public class OverseerControls : MonoBehaviour private TimeManager m_TimeManager; - private void Start() + private void Start() { m_TimeManager = GameObject.FindGameObjectWithTag("Time Manager").GetComponent(); } @@ -31,14 +36,14 @@ void Update() { triggerList(controllablesA); #if NETWORKING - NetMessenger.Instance.CmdOpenDoor("Green"); + NetMessenger.Instance.CmdOpenDoor("Green"); #endif } if (Input.GetButtonDown(actionButtonX)) { triggerList(controllablesX); #if NETWORKING - NetMessenger.Instance.CmdOpenDoor("Blue"); + NetMessenger.Instance.CmdOpenDoor("Blue"); #endif } if (Input.GetButtonDown(actionButtonB)) diff --git a/Assets/Scripts/Networking/NetMessenger.cs b/Assets/Scripts/Networking/NetMessenger.cs index 5d26946..5d76f0d 100644 --- a/Assets/Scripts/Networking/NetMessenger.cs +++ b/Assets/Scripts/Networking/NetMessenger.cs @@ -15,6 +15,8 @@ public class NetMessenger : NetworkBehaviour private void Awake() { + o = OverseerControls.Instance; + //o = GameObject.FindGameObjectWithTag("Overseer").GetComponent(); //Functions in this class MUST be invoked by the client and only the client //we are getting lucky here because the network manager is spawning //clientsHost and then client so this ends up being the client @@ -42,19 +44,19 @@ public void CmdOpenDoor(string color) { if (color == "Green") { - if (o == null) - { - o = GameObject.FindObjectOfType(); - } + //if (o == null) + //{ + // o = GameObject.FindObjectOfType(); + //} o.triggerList(o.controllablesA); } else if (color == "Blue") { //BlueDoor.GetComponent().SetTrigger("toggleObject"); - if (o == null) - { - o = GameObject.FindObjectOfType(); - } + //if (o == null) + //{ + // o = GameObject.FindObjectOfType(); + //} o.triggerList(o.controllablesX); } } diff --git a/Assets/Scripts/Networking/NetworkingCharacterAttachment.cs b/Assets/Scripts/Networking/NetworkingCharacterAttachment.cs index 0cecdbe..e2b5912 100644 --- a/Assets/Scripts/Networking/NetworkingCharacterAttachment.cs +++ b/Assets/Scripts/Networking/NetworkingCharacterAttachment.cs @@ -48,7 +48,6 @@ protected virtual void Start() } if (host) { - GetComponent().o = GameObject.FindGameObjectWithTag("Overseer").GetComponent(); BothHostAndClientsHost(); GameObject overseer = GameObject.FindGameObjectWithTag("Overseer"); @@ -58,8 +57,8 @@ protected virtual void Start() //for some reason 0 changes display to 1 lucky.GetComponent().targetDisplay = 0; - //if (overseer != null) - // GameObject.FindGameObjectWithTag("Overseer").SetActive(false); + if (overseer != null) + GameObject.FindGameObjectWithTag("Overseer").SetActive(false); gameObject.name = "host"; } diff --git a/Assets/hanisstuff/Playtest 8.unity b/Assets/hanisstuff/Playtest 8.unity index 9960fe6..0330bbb 100644 --- a/Assets/hanisstuff/Playtest 8.unity +++ b/Assets/hanisstuff/Playtest 8.unity @@ -2530,7 +2530,7 @@ Prefab: type: 2} propertyPath: m_TargetTexture value: - objectReference: {fileID: 493918472} + objectReference: {fileID: 719767403} - target: {fileID: 95535478316193998, guid: 0537e9a616f190341a12297467c884f9, type: 2} propertyPath: m_Enabled @@ -3118,28 +3118,6 @@ GameObject: m_PrefabParentObject: {fileID: 1649229833953150, guid: 868df6ca073273b46b0d14bf91e88925, type: 2} m_PrefabInternal: {fileID: 1428195643} ---- !u!84 &493918472 -RenderTexture: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: - m_ImageContentsHash: - serializedVersion: 2 - Hash: 00000000000000000000000000000000 - m_Width: 664 - m_Height: 688 - m_AntiAliasing: 2 - m_DepthFormat: 2 - m_ColorFormat: 0 - m_MipMap: 0 - m_GenerateMips: 1 - m_SRGB: 0 - m_TextureSettings: - m_FilterMode: 1 - m_Aniso: 1 - m_MipBias: 0 - m_WrapMode: 1 --- !u!1 &498487761 GameObject: m_ObjectHideFlags: 0 @@ -3683,28 +3661,6 @@ Transform: m_Father: {fileID: 1861190822} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!84 &628582098 -RenderTexture: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: - m_ImageContentsHash: - serializedVersion: 2 - Hash: 00000000000000000000000000000000 - m_Width: 664 - m_Height: 688 - m_AntiAliasing: 2 - m_DepthFormat: 2 - m_ColorFormat: 0 - m_MipMap: 0 - m_GenerateMips: 1 - m_SRGB: 0 - m_TextureSettings: - m_FilterMode: 1 - m_Aniso: 1 - m_MipBias: 0 - m_WrapMode: 1 --- !u!1 &629278006 GameObject: m_ObjectHideFlags: 0 @@ -4310,6 +4266,28 @@ MeshFilter: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 717686804} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!84 &719767403 +RenderTexture: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_Width: 503 + m_Height: 688 + m_AntiAliasing: 2 + m_DepthFormat: 2 + m_ColorFormat: 0 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 0 + m_TextureSettings: + m_FilterMode: 1 + m_Aniso: 1 + m_MipBias: 0 + m_WrapMode: 1 --- !u!1 &719953071 GameObject: m_ObjectHideFlags: 0 @@ -7850,6 +7828,28 @@ MeshFilter: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1525453800} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!84 &1526370392 +RenderTexture: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_Width: 503 + m_Height: 688 + m_AntiAliasing: 2 + m_DepthFormat: 2 + m_ColorFormat: 0 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 0 + m_TextureSettings: + m_FilterMode: 1 + m_Aniso: 1 + m_MipBias: 0 + m_WrapMode: 1 --- !u!1 &1527006237 GameObject: m_ObjectHideFlags: 0 @@ -9697,7 +9697,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: pivot: {fileID: 600567086} - startingTarget: 0 + startingTarget: 1 positionOffset: {x: -6.610001, y: 25.79, z: -27.7} --- !u!1 &1750368987 GameObject: