using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameraMove : MonoBehaviour
{
public Transform player;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(player.position.x>0.6&&player.position.y>-6.5f)
{
Move();
}
}
public void Move()
{
transform.position = new Vector3(player.position.x, player.position.y, -10);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
public static GameManager instance;
public GameObject victroy;
public int mark=4;
// Start is called before the first frame update
void Start()
{
instance = this;
victroy.SetActive(false);
}
// Update is called once per frame
void Update()
{
Victroy();
}
//显示胜利面板
public void Victroy()
{
if(PlayerControl.instance.speed==0)
{
Time.timeScale = 0;
victroy.SetActive(true);
}
}
public void OnReplay()
{
Time.timeScale = 1;
victroy.SetActive(false);
//跳转到本游戏关卡
}
}