using System.Collections; using System.Collections.Generic; using UnityEngine; namespace BuildSystem { public class PlaceObject : MonoBehaviour { public string nameString=""; public int width; public int height; public DirIsHaveRoad[] isHaveRoad = new DirIsHaveRoad[4];//方向是否有道路 public RoadNumberType[] roadNumberType = new RoadNumberType[4];//道路车道类型 public RoadType roadType;//道路类型 public List canGoinfo; public void Init(string nameString,int width,int height,RoadNumberType[] type,DirIsHaveRoad[] ishave, RoadType roadType, List canGoinfo) { this.nameString = nameString; this.width = width; this.height = height; this.roadNumberType = type; this.isHaveRoad = ishave; this.roadType = roadType; this.canGoinfo = new List(); this.canGoinfo = canGoinfo; } /// /// 设置焦点距离 /// /// public void SetPosition(Vector3 pos) { Vector3 target = new Vector3((float)(width * BuildSystemManager.Instance.gridSize) / 2 - (float)(BuildSystemManager.Instance.gridSize * 0.5f), transform.position.y, (float)(height * BuildSystemManager.Instance.gridSize) / 2 - (float)(BuildSystemManager.Instance.gridSize * 0.5f)); transform.position = pos + target; } } }