mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 01:12:05 +07:00
25 lines
509 B
C#
25 lines
509 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class CircleFlyCamera : MonoBehaviour {
|
|
|
|
public float FlyRadius = 150.0f;
|
|
public float FlySpeed = 1.0f;
|
|
|
|
Vector3 _start_pos;
|
|
float _fly_timer;
|
|
|
|
void Start() {
|
|
_start_pos = transform.position;
|
|
_fly_timer = 0.0f;
|
|
}
|
|
|
|
void Update () {
|
|
_fly_timer += FlySpeed * Time.deltaTime;
|
|
transform.position = new Vector3(
|
|
_start_pos.x + Mathf.Cos(_fly_timer) * FlyRadius,
|
|
_start_pos.y + Mathf.Sin(_fly_timer) * FlyRadius,
|
|
_start_pos.z);
|
|
}
|
|
}
|