using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class follow : MonoBehaviour
{
public static bool lose;
public static bool win;
public GameObject lose_ui;
public GameObject victory_ui;
void Start()
{
lose = false;
win = false;
victory_ui.SetActive(false);
lose_ui.SetActive(false);
}
void Update()
{
if (lose == true)
{
lose_ui.SetActive(true);
}
if (win == true)
{
Debug.Log("胜利了~~");
victory_ui.SetActive(true);
}
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "。")
{
GetComponent<Rigidbody>().velocity = new Vector3(0, 0, 0);
gameObject.transform.SetParent(other.transform);
}
if (other.tag == "。")
win = true;
}
public void backgame()
{
SceneManager.LoadScene("1");
}
}
Scene
最新推荐文章于 2024-05-01 21:15:57 发布