コード例 #1
0
 // 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();
 }
コード例 #2
0
 // 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;
 }
コード例 #3
0
 void OnDestroy()
 {
     singleton = null;
 }