Browse Source

more bug fixes

master
KG 7 years ago
parent
commit
e3641a6ab7
7 changed files with 17 additions and 4 deletions
  1. +0
    -2
      IronToad_UnityProject/Assets/Scripts/AlertController.cs
  2. +5
    -0
      IronToad_UnityProject/Assets/Scripts/AudioController.cs
  3. +1
    -0
      IronToad_UnityProject/Assets/Scripts/LightBeam.cs
  4. +2
    -0
      IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs
  5. +3
    -2
      IronToad_UnityProject/Assets/Scripts/Searchlight.cs
  6. +6
    -0
      IronToad_UnityProject/Assets/Scripts/VictoryScript.cs
  7. BIN
      IronToad_UnityProject/Assets/_Scenes/IGDA_Lighthouse.unity

+ 0
- 2
IronToad_UnityProject/Assets/Scripts/AlertController.cs View File

@ -17,14 +17,12 @@ public class AlertController : MonoBehaviour
NotificationServer.register("spotted boat", spottedBoat); NotificationServer.register("spotted boat", spottedBoat);
NotificationServer.register("lost boat", lostBoat); NotificationServer.register("lost boat", lostBoat);
NotificationServer.register("restart scene", restartScene); NotificationServer.register("restart scene", restartScene);
// originalPos = text.rectTransform.anchoredPosition3D;
} }
public void spottedBoat() public void spottedBoat()
{ {
LeanTween.cancel(text.gameObject, false); LeanTween.cancel(text.gameObject, false);
LeanTween.cancel(slider.gameObject, false); LeanTween.cancel(slider.gameObject, false);
// lastSpotted = Time.timeSinceLevelLoad;
NotificationServer.notify("show AlertText"); NotificationServer.notify("show AlertText");
text.text = "hide!"; text.text = "hide!";
setTimer(0f); setTimer(0f);

+ 5
- 0
IronToad_UnityProject/Assets/Scripts/AudioController.cs View File

@ -27,6 +27,7 @@ public class AudioController : MonoBehaviour
NotificationServer.register("fade amb", fadeAmb); NotificationServer.register("fade amb", fadeAmb);
NotificationServer.register("statechange Searchlight", searchlightStateChanged); NotificationServer.register("statechange Searchlight", searchlightStateChanged);
NotificationServer.register("restart scene", restartScene);
} }
void Start() void Start()
@ -75,6 +76,10 @@ public class AudioController : MonoBehaviour
} }
} }
public void restartScene()
{
searchState = Searchlight.SearchState.Spline;
}
public void playAmb(object audioNameObj) public void playAmb(object audioNameObj)
{ {

+ 1
- 0
IronToad_UnityProject/Assets/Scripts/LightBeam.cs View File

@ -31,6 +31,7 @@ public class LightBeam : MonoBehaviour {
} }
private void resetState() { private void resetState() {
searchState = Searchlight.SearchState.Spline;
lightBeam.gameObject.SetActive(true); lightBeam.gameObject.SetActive(true);
target.gameObject.SetActive(true); target.gameObject.SetActive(true);
GetComponent<Animator>().SetBool("isSeen", false); GetComponent<Animator>().SetBool("isSeen", false);

+ 2
- 0
IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs View File

@ -77,6 +77,8 @@ public class LighthouseLanding : MonoBehaviour
public void restartScene() public void restartScene()
{ {
searchState = Searchlight.SearchState.Spline;
switchedOff = false; switchedOff = false;
isTriggering = false;
} }
} }

+ 3
- 2
IronToad_UnityProject/Assets/Scripts/Searchlight.cs View File

@ -32,7 +32,7 @@ public class Searchlight : MonoBehaviour
{ {
foreach (Searchlight sl in instants) foreach (Searchlight sl in instants)
{ {
if (sl.isTriggering)
if (sl.isActiveAndEnabled && sl.isTriggering)
return true; return true;
} }
return false; return false;
@ -43,9 +43,9 @@ public class Searchlight : MonoBehaviour
NotificationServer.register("statechange Searchlight safe", stateSafe); NotificationServer.register("statechange Searchlight safe", stateSafe);
NotificationServer.register("statechange Searchlight returning", stateReturning); NotificationServer.register("statechange Searchlight returning", stateReturning);
NotificationServer.register("spotted boat", spottedBoat); NotificationServer.register("spotted boat", spottedBoat);
NotificationServer.register("restart scene", stateSafe);
if (!instants.Contains(this)) if (!instants.Contains(this))
instants.Add(this); instants.Add(this);
} }
void OnTriggerEnter(Collider other) void OnTriggerEnter(Collider other)
@ -80,6 +80,7 @@ public class Searchlight : MonoBehaviour
public void stateSafe() public void stateSafe()
{ {
state = SearchState.Spline; state = SearchState.Spline;
isTriggering = false;
LeanTween.cancel(chaseID, false); LeanTween.cancel(chaseID, false);
} }

+ 6
- 0
IronToad_UnityProject/Assets/Scripts/VictoryScript.cs View File

@ -17,6 +17,7 @@ public class VictoryScript : MonoBehaviour
isTriggering = true; isTriggering = true;
NotificationServer.notify("show VictoryButton"); NotificationServer.notify("show VictoryButton");
NotificationServer.register("restart scene", restartScene);
} }
void OnTriggerExit(Collider other) void OnTriggerExit(Collider other)
@ -48,4 +49,9 @@ public class VictoryScript : MonoBehaviour
NotificationServer.notify("show VictoryPanel"); NotificationServer.notify("show VictoryPanel");
NotificationServer.notify("hide GameUI"); NotificationServer.notify("hide GameUI");
} }
public void restartScene()
{
isTriggering = false;
}
} }

BIN
IronToad_UnityProject/Assets/_Scenes/IGDA_Lighthouse.unity View File


Loading…
Cancel
Save