constructed entryway for skywalk
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user