Exemplo n.º 1
0
 void Update()
 {
     if (!isLocalPlayer)
     {
         return;
     }
     if (radius <= 0)
     {
         return;
     }
     if (m_OriginPosition != transform.position)
     {
         m_OriginPosition = transform.position;
         var pos = FogOfWarEffect.WorldPositionToFOW(transform.position);
         if (m_FowMapPos.x != pos.x || m_FowMapPos.y != pos.y || !m_IsInitialized)
         {
             m_FowMapPos          = pos;
             m_IsInitialized      = true;
             m_FieldData.position = transform.position;
             m_FieldData.radius   = radius;
             //FogOfWarEffect.SetVisibleAtPosition(m_FieldData);
             FogOfWarEffect.UpdateFOWFieldData(m_FieldData);
         }
     }
 }
Exemplo n.º 2
0
    void Update()
    {
        if (radius <= 0)
        {
            return;
        }
        var pos = FogOfWarEffect.WorldPositionToFOW(transform.position);

        if (m_FowMapPos.x != pos.x || m_FowMapPos.y != pos.y || first_time)
        {
            m_FowMapPos          = pos;
            first_time           = true;
            m_FieldData.position = transform.position;
            m_FieldData.radius   = radius;
            //FogOfWarEffect.SetVisibleAtPosition(m_FieldData);
            FogOfWarEffect.UpdateFOWFieldData(m_FieldData);
        }
    }