You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
874 B
40 lines
874 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Cinemachine;
|
|
public class CameraControy: MonoBehaviour
|
|
{
|
|
public GameObject initobj;
|
|
CinemachineFreeLook cin;
|
|
private void Awake()
|
|
{
|
|
cin = GetComponent<CinemachineFreeLook>();
|
|
}
|
|
private void OnEnable()
|
|
{
|
|
cin.Follow = initobj.transform;
|
|
cin.LookAt = initobj.transform;
|
|
cin.m_YAxis.m_MaxSpeed = 0;
|
|
cin.m_XAxis.m_MaxSpeed = 0;
|
|
}
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (Input.GetMouseButtonDown(0))
|
|
{
|
|
cin.m_YAxis.m_MaxSpeed = 8;
|
|
cin.m_XAxis.m_MaxSpeed = 250;
|
|
}
|
|
if (Input.GetMouseButtonUp(0))
|
|
{
|
|
cin.m_YAxis.m_MaxSpeed = 0;
|
|
cin.m_XAxis.m_MaxSpeed = 0;
|
|
}
|
|
}
|
|
}
|