little fox parkour 5

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();     }     //Display the victory panel     public void Victroy()     {         if(PlayerControl.instance.speed==0)         {             Time.timeScale = 0;             victroy.SetActive (true);         }     }     public void OnReplay()     {         Time.timeScale = 1;         victroy.SetActive(false);         //Jump to this game level     } }


















 

Guess you like

Origin blog.csdn.net/qq_57388481/article/details/127457215