// Start is called before the first frame update void Start() { viewPort = NavMeshViewPort.GetSingleton(); cellLayerMask = LayerMask.GetMask(navMeshLayerName); terrainLayerMask = LayerMask.GetMask(terrainTestLayerName); vp_rightAlignPrev = viewPort.GetRightAlign(baseCellDim); vp_leftAlignPrev = viewPort.GetLeftAlign(baseCellDim); vp_topAlignPrev = viewPort.GetTopAlign(baseCellDim); vp_bottomAlignPrev = viewPort.GetBottomAlign(baseCellDim); privFillCells(); }
// Start is called before the first frame update void Awake() { if (singleton == null) { singleton = this; } else { Debug.LogError("Duplicate NavMeshViewPort!"); } originRefX = gameObject.transform.position.x; originRefY = gameObject.transform.position.y; }
void OnDestroy() { singleton = null; }