25 lines
617 B
C#
25 lines
617 B
C#
|
|
using System.Collections;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
public class Gamification_CameraMove : MonoBehaviour
|
|||
|
|
{
|
|||
|
|
Transform player;
|
|||
|
|
public Vector2 dif = new Vector2(0, 0);
|
|||
|
|
|
|||
|
|
public static Gamification_CameraMove instance;
|
|||
|
|
|
|||
|
|
// Start is called before the first frame update
|
|||
|
|
void Awake()
|
|||
|
|
{
|
|||
|
|
instance = this;
|
|||
|
|
player = GameObject.Find("Player").GetComponent<Transform>();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// Update is called once per frame
|
|||
|
|
void FixedUpdate()
|
|||
|
|
{
|
|||
|
|
transform.position = Vector2.Lerp(transform.position, (Vector2)player.position + dif, .05f);
|
|||
|
|
}
|
|||
|
|
}
|