Пример #1
0
    /// <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);
        }
    }
Пример #2
0
    // 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);
    }