/// <summary> /// Checks if this unit needs to update. /// Called by update loop. /// </summary> public void CheckUpdateFow() { int newGridIndex = FowManager.GetGridIndex(this.transform.position); if (newGridIndex != gridIndex) { gridIndex = newGridIndex; fowMan.UpdateFow(this); } }
// Start is called before the first frame update void Start() { //find index and update my fow gridIndex = FowManager.GetGridIndex(this.transform.position); fowMan = FowManager.GetInstance(); fowMan.unitFows.Add(this); //init spatial indexing mySquares = new List <SpatialGridSquareController>(); int viewDist = fowMan.fowCalcArchetypes[fowCalcArchetypeID].viewDist; mySpatialCollider.radius = viewDist * 2; //worldsize = 2 //updateMyFOW(); //Deprecated fowMan.UpdateFow(this); }