From 99d5b7911a17f3f320ba8c9932e213e4d0bcf059 Mon Sep 17 00:00:00 2001 From: Sagittaeri Date: Sun, 22 Jan 2017 15:11:48 +1100 Subject: [PATCH] lighthouse takeover --- .../Assets/Scripts/LighthouseLanding.cs | 61 ++++++++++++++++++ .../Assets/Scripts/LighthouseLanding.cs.meta | 12 ++++ .../Assets/_Scenes/LighthouseTestScene.unity | Bin 137912 -> 141460 bytes 3 files changed, 73 insertions(+) create mode 100644 IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs create mode 100644 IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs.meta diff --git a/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs b/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs new file mode 100644 index 0000000..80827a0 --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs @@ -0,0 +1,61 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LighthouseLanding : MonoBehaviour +{ + public bool switchedOff = false; + + private bool isTriggering = false; + + void Awake() + { + NotificationServer.register("statechange Searchlight", searchlightStateChanged); + } + + void OnTriggerEnter(Collider other) + { + if (switchedOff) + return; + if (other.tag != "Player") + return; + if (Searchlight.state == Searchlight.SearchState.Chasing) + return; + if (isTriggering) + return; + + isTriggering = true; + NotificationServer.notify("show TakeoverButton"); + } + + void OnTriggerExit(Collider other) + { + if (switchedOff) + return; + if (other.tag != "Player") + return; + if (!isTriggering) + return; + + isTriggering = false; + NotificationServer.notify("hide TakeoverButton"); + } + + void searchlightStateChanged() + { + if (switchedOff) + return; + if (isTriggering && Searchlight.state == Searchlight.SearchState.Chasing) + { + isTriggering = false; + NotificationServer.notify("hide TakeoverButton"); + } + } + + public void switchOff() + { + switchedOff = true; + NotificationServer.notify("hide TakeoverButton"); + NotificationServer.notify("play sfx", "assassination"); + } +} diff --git a/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs.meta b/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs.meta new file mode 100644 index 0000000..8c04dbc --- /dev/null +++ b/IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d48154a3b477045e68763f6fc4a168b7 +timeCreated: 1485057688 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/_Scenes/LighthouseTestScene.unity b/IronToad_UnityProject/Assets/_Scenes/LighthouseTestScene.unity index f83363ec28875501ef519fe50300b890780a6df9..a51988c9237ef3558fba73fc0f348326ee637fc8 100644 GIT binary patch delta 5865 zcmYkA3sjX=7RS%NT;M8*7el=o3O*_wUpQ)Fn%>fc6arS3;Fw+%1;-cS3r)S6`N}j3 z^`NGLSvr}ETa=e92{jd8g^CTL=5Scsj zw?C$^V$6cyBgF?3!+t+F<6_3v`=8uz+SWX9<|J)d_I5jH^)Ku6;&9tL*X@N5#zqwu zj_=-l;k0>^bEagaOr2Vmx8{hGT9)-M+S8GoWtR`u2T^3%(L*VAYE{HPf@finA-cZ z+EWV$J?hWvOgHVeLFAwG1pVyruJ>$sTsdF-k`QwsgVEk(=6YF(BJ@MhHZb#n#gP!9 zU>lhQ#tP95eFxgS?HhVP2uHdQC6LPAd}cndJ?JZY3ryw}=^0Rl!3e;GtmqksIHBJX zEuUEtn8PMSGq6R>ipLA##MtIwi<$Xev78yyqF+zE618A@aZfQzouC%yHN6?kupUqw z9Kx(=qGhn^$k=|$V5~=o&mq<7PB9CBso7egoo43DG}$9yXPCK}MS-35GRy^h8=y7X zIcAPYLgbv*M{%N{TOhHvq3hE!YZ3Ww3;qC);v*H?wLm<)AA6_n5`z z2$3id|Mq}qel8pYA#wm$K`Mi1nKgiYiN13195dfE%b9PO)q|9AnOZ5tjP{rf%gpnpbz%-@)&!<^Q>?tDvM6$pBfYpz%xb~R#bN!O z88&RR2CuliJ3|fjyoF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