optimized level, updated shooting system, and fixed enemy death still causing damage bug
This commit is contained in:
@ -28,6 +28,7 @@ public class InGameMenuManager : MonoBehaviour
|
||||
}
|
||||
void SettingsUnClicked()
|
||||
{
|
||||
|
||||
menuAnimator.SetBool("SettingsOpen", false);
|
||||
}
|
||||
public void UpdateSensitivity()
|
||||
|
54
Assets/Scripts/Game/Optimizer.cs
Normal file
54
Assets/Scripts/Game/Optimizer.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Attach this behavior to a master room collider. Enables everything in this room OnTriggerEnter of [tag]
|
||||
/// disables everything in this room OnTriggerExit of [tag]
|
||||
/// </summary>
|
||||
public class Optimizer : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public string Tag;
|
||||
[SerializeField]
|
||||
private GameObject[] references;
|
||||
[SerializeField]
|
||||
private bool beginDisabled = true;
|
||||
private void Start()
|
||||
{
|
||||
if (beginDisabled)
|
||||
{
|
||||
Disable();
|
||||
}
|
||||
}
|
||||
public void Enable()
|
||||
{
|
||||
foreach (GameObject go in references)
|
||||
{
|
||||
go.SetActive(true);
|
||||
}
|
||||
}
|
||||
public void Disable()
|
||||
{
|
||||
foreach (GameObject go in references)
|
||||
{
|
||||
go.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.CompareTag(Tag))
|
||||
{
|
||||
Enable();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.CompareTag(Tag))
|
||||
{
|
||||
Disable();
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Game/Optimizer.cs.meta
Normal file
11
Assets/Scripts/Game/Optimizer.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce10ec9aaa603bb4da9dfadd6e590584
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user