Commit f41476f1 authored by Michael But's avatar Michael But

Updatet SavePoint

parent d53ec134
fileFormatVersion: 2
guid: bc43ac6a6d9af5e44b800027e40c1e84
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: a557c41513022e744831753cb4ad512f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -3,32 +3,36 @@ using System.Collections.Generic;
using UnityEngine;
using LevelauswahlScript;
using PlayerSpawnPointScript;
using UnityEngine.UI;
public class SavePoint : MonoBehaviour
{
private bool isUsed;
private Transform options;
public Button button;
private void Start()
{
button.interactable = false;
isUsed = false;
options = gameObject.transform.Find("Options");
}
public void OnTriggerEnter2D(Collider2D other)
{
options.gameObject.SetActive(true);
//options.gameObject.SetActive(true);
}
public void OnTriggerExit2D(Collider2D other)
{
options.gameObject.SetActive(false);
//options.gameObject.SetActive(false);
}
public void OnTriggerStay2D(Collider2D collision)
{
if (Input.GetButtonDown("Interact"))
{
button.interactable = true;
isUsed = true;
SaveSystem.SavePointUpdate(this);
} else if (Input.GetButtonDown("Teleport") && Levelauswahl.la.auswahlIsActive() == false)
......@@ -44,6 +48,7 @@ public class SavePoint : MonoBehaviour
public void SetIsUsed(bool var)
{
button.interactable = var;
isUsed = var;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment