Browse Source

lighthouse takeover

master
Sagittaeri 7 years ago
parent
commit
99d5b7911a
3 changed files with 73 additions and 0 deletions
  1. +61
    -0
      IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs
  2. +12
    -0
      IronToad_UnityProject/Assets/Scripts/LighthouseLanding.cs.meta
  3. BIN
      IronToad_UnityProject/Assets/_Scenes/LighthouseTestScene.unity

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

@ -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");
}
}

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

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d48154a3b477045e68763f6fc4a168b7
timeCreated: 1485057688
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

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


Loading…
Cancel
Save