35 lines
1003 B
C#
35 lines
1003 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Thousandto.Launcher.ExternalLibs
|
|
{
|
|
/// <summary>
|
|
/// 视口
|
|
/// </summary>
|
|
public class MapPortal
|
|
{
|
|
//索引
|
|
public int id;
|
|
//视口的最小点坐标和最大点坐标
|
|
public Vector3 min = Vector3.zero;
|
|
public Vector3 max = Vector3.zero;
|
|
//视口射线起始坐标list
|
|
public List<Vector3> rayStartPointList;
|
|
//当前视口可视物件的Trans
|
|
public List<Transform> transList = new List<Transform>();
|
|
|
|
public MapPortal(int index, int part, float celWide, float celHigh, Vector2 min)
|
|
{
|
|
int rl = index % part; //列
|
|
int cl = index / part; //行
|
|
id = index;
|
|
this.min.x = min.x + celWide * rl;
|
|
this.min.z = min.y + celHigh * cl;
|
|
max.x = this.min.x + celWide;
|
|
max.z = this.min.z + celWide;
|
|
}
|
|
}
|
|
}
|
|
|