45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.SceneManagement;
|
||
|
|
|
||
|
|
public class MainScene : MonoBehaviour
|
||
|
|
{
|
||
|
|
public bool isWB;
|
||
|
|
|
||
|
|
bool isEnter;
|
||
|
|
|
||
|
|
// Update is called once per frame
|
||
|
|
void OnTriggerEnter(Collider other)
|
||
|
|
{
|
||
|
|
if (other.name.StartsWith("SceneCollider"))
|
||
|
|
{
|
||
|
|
BaseController.CanControl = false;
|
||
|
|
if (isWB)
|
||
|
|
{
|
||
|
|
CommonData.MainCamera.GetComponent<NavController>().StopNav();
|
||
|
|
isEnter = true;
|
||
|
|
}
|
||
|
|
|
||
|
|
BtnController btnCtrl = FindObjectOfType<BtnController>();
|
||
|
|
if (btnCtrl != null)
|
||
|
|
{
|
||
|
|
btnCtrl.OnBtnExLoaderClick();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
void Update()
|
||
|
|
{
|
||
|
|
if (isEnter)
|
||
|
|
{
|
||
|
|
CommonData.MainCamera.transform.localPosition =
|
||
|
|
Vector3.Lerp(CommonData.MainCamera.transform.localPosition, new Vector3(-111, -8, -111),Time.deltaTime);
|
||
|
|
CommonData.MainCamera.transform.localRotation =
|
||
|
|
Quaternion.Euler(
|
||
|
|
Vector3.Lerp(CommonData.MainCamera.transform.localEulerAngles, new Vector3(0, 50, 0),Time.deltaTime)
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|