54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
//============================================================
|
||
//支持中文,文件使用UTF-8编码
|
||
//@author YangHua
|
||
//@create 20230531
|
||
//@company Adam
|
||
//
|
||
//@description:
|
||
//============================================================
|
||
namespace Focus
|
||
{
|
||
public class SwitchViews : MonoBehaviour
|
||
{
|
||
|
||
public Transform viewOne;
|
||
public Transform viewTwo;
|
||
|
||
public void OnViewOneClick()
|
||
{
|
||
CameraMgr.Instance.GotoView(viewOne, 10f);
|
||
}
|
||
|
||
public void OnViewTwoClick()
|
||
{
|
||
CameraMgr.Instance.GotoView(viewTwo, 10f);
|
||
}
|
||
|
||
public Bounds CalculateBounding(List<GameObject> objs)
|
||
{
|
||
if (objs.Count > 0)
|
||
{
|
||
Bounds b = objs[0].GetComponent<Renderer>().bounds;
|
||
if (objs.Count > 1)
|
||
{
|
||
for (int i = 1; i < objs.Count; i++)
|
||
{
|
||
b.Encapsulate(objs[i].GetComponent<Renderer>().bounds);
|
||
}
|
||
return b;
|
||
}
|
||
else
|
||
{
|
||
return b;
|
||
}
|
||
}
|
||
return new Bounds();
|
||
}
|
||
|
||
}
|
||
|
||
}
|