mirror of
https://github.com/ConjureETS/VZ.git
synced 2026-03-24 02:11:15 +00:00
add the possibility of changing destination of the camera transition before it reaches its destination.
28 lines
801 B
C#
28 lines
801 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class Player2Controller : MonoBehaviour {
|
|
|
|
public SquadCamera squadCamera;
|
|
public Squad[] squads;
|
|
|
|
// Use this for initialization
|
|
void Start () {
|
|
squadCamera.SetTarget(squads[0].gameObject.transform.position);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
|
|
if (Input.GetAxisRaw("Opt1-2") == 1f) {
|
|
squadCamera.SetTarget(squads[0].gameObject.transform.position);
|
|
}
|
|
else if (Input.GetAxisRaw("Opt2-2") == 1f) {
|
|
squadCamera.SetTarget(squads[1].gameObject.transform.position);
|
|
}
|
|
else if (Input.GetAxisRaw("Opt3-2") == 1f) {
|
|
squadCamera.SetTarget(squads[2].gameObject.transform.position);
|
|
}
|
|
}
|
|
}
|