ADD
This commit is contained in:
parent
14e843f081
commit
e8ac7e032e
File diff suppressed because it is too large
Load Diff
@ -23,15 +23,13 @@ public class JinBidaoBtn : MonoBehaviour
|
||||
|
||||
IEnumerator Magnify()
|
||||
{
|
||||
yield return null;
|
||||
transform.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutBack);
|
||||
|
||||
yield return new WaitForSeconds(0.3f);
|
||||
OnSceneMouseBTN();
|
||||
yield return null;
|
||||
}
|
||||
|
||||
void JUmpScem()
|
||||
{
|
||||
SceneGuodu.instance.SlideInAndLoadScene(JumpScene.cultivation_gold_coin_Island);
|
||||
Virtual_CameraManager.Instance.SwitchToCamera(2);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,6 @@ public class ZuanshiBtn : MonoBehaviour
|
||||
|
||||
void JUmpScem()
|
||||
{
|
||||
JumpScene.jumpbool = 5;
|
||||
Virtual_CameraManager.Instance.SwitchToCamera(1);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ public class jinTols : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
SceneGuodu.instance.SlideInAndLoadScene(scene);
|
||||
Virtual_CameraManager.Instance.SwitchToCamera(0);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -5,7 +5,7 @@ using UnityEngine.SceneManagement;
|
||||
|
||||
public class JumpScene
|
||||
{
|
||||
public static int jumpbool = 5;
|
||||
public static int jumpbool = 2;
|
||||
public static string lodingid = "1";
|
||||
public const string Choose_the_main_character= "Choose_the_main_character";
|
||||
public const string clan_slices ="clan_slices";
|
||||
|
56
meng_yao/Assets/script/Virtual_CameraManager.cs
Normal file
56
meng_yao/Assets/script/Virtual_CameraManager.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using Cinemachine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
|
||||
public class Virtual_CameraManager : MonoBehaviour
|
||||
{
|
||||
public static Virtual_CameraManager Instance;
|
||||
public List<CinemachineVirtualCamera> Cameralist = new List<CinemachineVirtualCamera>();
|
||||
public List<Canvas> Canvaslist = new List<Canvas>();
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
Instance = this;
|
||||
// 确保只有第一个虚拟摄像机被启用,其他摄像机禁用
|
||||
for (int i = 0; i < Cameralist.Count; i++)
|
||||
{
|
||||
Cameralist[i].Priority = (i == 0) ? 10 : 0;
|
||||
}
|
||||
|
||||
HideCanvas();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SwitchToCamera(int cameraIndex)
|
||||
{
|
||||
// 将所有摄像机优先级降低
|
||||
for (int i = 0; i < Cameralist.Count; i++)
|
||||
{
|
||||
Cameralist[i].Priority = 0;
|
||||
}
|
||||
|
||||
// 提升选中摄像机的优先级
|
||||
Cameralist[cameraIndex].Priority = 10;
|
||||
HideCanvas();
|
||||
Canvaslist[cameraIndex].gameObject.SetActive(true);
|
||||
Debug.Log($"切换到摄像机 {cameraIndex + 1}");
|
||||
}
|
||||
|
||||
|
||||
void HideCanvas()
|
||||
{
|
||||
for (int i = 0; i < Canvaslist.Count; i++)
|
||||
{
|
||||
Canvaslist[i].gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
11
meng_yao/Assets/script/Virtual_CameraManager.cs.meta
Normal file
11
meng_yao/Assets/script/Virtual_CameraManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25fab4b9dc4e9034daff2c75d5b1c4ed
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user