prepping for new skywalk system

This commit is contained in:
2025-01-22 19:43:13 +02:00
parent 7ba5fe1f30
commit 42aacaafb4
16 changed files with 788 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MenuReference : MonoBehaviour
{
public List<MenuTeleportButton> buttons;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 10d4b92fb83665e409f8d654c0a3295c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TeleportLocationCollider : MonoBehaviour
{
public TeleportLocation parent;
private void OnTriggerEnter(Collider other)
{
MenuReference reference = other.GetComponent<MenuReference>();
if (reference == null) return;
List<MenuTeleportButton> buttonsList = reference.buttons;
MenuTeleportButton button = findCorrespondingButton(buttonsList);
if (button != null)
{
button.SetStateSelected();
}
}
private void OnTriggerExit(Collider other)
{
MenuReference reference = other.GetComponent<MenuReference>();
if (reference == null) return;
List<MenuTeleportButton> buttonsList = other.GetComponent<MenuReference>().buttons;
MenuTeleportButton button = findCorrespondingButton(buttonsList);
if (button != null)
{
button.SetStateDefault();
}
//Debug.Log(other.name + " exited the area");
}
private MenuTeleportButton findCorrespondingButton(List<MenuTeleportButton> buttons)
{
foreach (MenuTeleportButton button in buttons)
{
if (button.TargetName.Equals(parent.Name))
{
return button;
}
}
Debug.Log("Teleport location of " + parent.Name + " was unable to find the button triggering it");
return null;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: becc71823bf144d48b8395ee9683eac4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: