constructed entryway for skywalk

This commit is contained in:
Ranno Samuel Adson
2025-01-15 21:44:46 +02:00
parent 7ba5fe1f30
commit 776c68736d
14 changed files with 1136 additions and 88 deletions

View File

@@ -7,9 +7,7 @@ public class FloorButtonVisualizer : MonoBehaviour
{
public Sprite InactiveSprite;
public Sprite ActiveSprite;
public float FloorUpperCoordiantes;
public float FloorLowerCoordiantes;
private bool activeState = true;
public bool ActiveState;
private Image buttonImage;
// Start is called before the first frame update
void Start()
@@ -17,25 +15,16 @@ public class FloorButtonVisualizer : MonoBehaviour
buttonImage = gameObject.GetComponent<Image>();
}
// Update is called once per frame
void Update()
public void Activate()
{
float height = gameObject.transform.position.y;
if (height < FloorUpperCoordiantes && height > FloorLowerCoordiantes)
{
if (!activeState) {
activeState = true;
buttonImage.sprite = ActiveSprite;
}
}
else
{
if (activeState)
{
activeState = false;
buttonImage.sprite = InactiveSprite;
}
}
this.ActiveState = true;
buttonImage.sprite = ActiveSprite;
//Debug.Log("Floorbutton of " + gameObject.name + " activated");
}
public void Deactivate()
{
this.ActiveState = false;
buttonImage.sprite = InactiveSprite;
//Debug.Log("Floorbutton of " + gameObject.name + " deactivated");
}
}