From e88cce9975265b9818dfbe489778787a4cebaab9 Mon Sep 17 00:00:00 2001 From: hani-sayegh Date: Fri, 24 Feb 2017 21:10:24 -0500 Subject: [PATCH] #5 stash --- .../Scripts/Controls/OverSeer/OverseerControls.cs | 1 - Assets/Scripts/Networking/NetMessenger.cs | 15 +++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/Controls/OverSeer/OverseerControls.cs b/Assets/Scripts/Controls/OverSeer/OverseerControls.cs index d6160a6..0399a4e 100644 --- a/Assets/Scripts/Controls/OverSeer/OverseerControls.cs +++ b/Assets/Scripts/Controls/OverSeer/OverseerControls.cs @@ -20,7 +20,6 @@ void Update() if (Input.GetButtonDown(actionButtonA)) { triggerList(controllablesA); - #if NETWORKING NetMessenger.Instance.CmdOpenDoor("Green"); #endif diff --git a/Assets/Scripts/Networking/NetMessenger.cs b/Assets/Scripts/Networking/NetMessenger.cs index 52d3ae2..e02b408 100644 --- a/Assets/Scripts/Networking/NetMessenger.cs +++ b/Assets/Scripts/Networking/NetMessenger.cs @@ -7,19 +7,19 @@ public class NetMessenger : NetworkBehaviour { public static NetMessenger Instance; public GameObject GreenDoor; - //public GameObject BlueDoor; + public GameObject BlueDoor; private void Start() { Instance = this; //GreenDoor = GameObject.FindGameObjectWithTag("Door Green"); - //GreenDoor = GameObject.Find("DoorGreen"); + GreenDoor = GameObject.Find("DoorGreen"); Debug.Log(GreenDoor); - Debug.Log("FREEEEEEEferferf"); if (GreenDoor == null) Debug.Break(); //BlueDoor = GameObject.FindGameObjectWithTag("Door Blue"); + BlueDoor = GameObject.Find("DoorBlue"); } public GameObject beaconPrefab; @@ -36,11 +36,10 @@ public void CmdSpawn(Vector3 position) [Command] public void CmdOpenDoor(string color) { - var io = GreenDoor.transform; if (color == "Green") - GreenDoor.GetComponent(); - //GreenDoor.GetComponent().SetTrigger("toggleObject"); - //else if (color == "Blue") - // BlueDoor.GetComponent().SetTrigger("toggleObject"); + GreenDoor.GetComponent().SetTrigger("toggleObject"); + //GreenDoor.GetComponent(); + else if (color == "Blue") + BlueDoor.GetComponent().SetTrigger("toggleObject"); } }