public void Initialize(CEFowProperty _property)
        {
            mProperty = _property;

            var mapSize = CEFowFacade.instance.fowMapWidth * CEFowFacade.instance.fowMapHeight;

            mCacheStaticViewMapData = new bool[mapSize];
            mColorBuffer            = new Color[mapSize];

            mBlurShader = Shader.Find("Hidden/Eran/FOW/Blur");
            if (mBlurShader != null)
            {
                mBlurMT = new Material(mBlurShader);
            }
        }
    // Start is called before the first frame update
    private void Start()
    {
        mProperty = new CEFowProperty
        {
            FowMapWidth        = FowTextureSize,
            FowMapHeight       = FowTextureSize,
            WorldMapWidth      = worldWidth,
            WorldMapHeight     = worldHeight,
            blurIterations     = blurIterations,
            blurOffset         = blurOffset,
            blurSimpleDownSize = blurSimpleDownSize
        };

        CEFowFacade.instance.InitAsNew(mProperty);

        actor.Initialize();
        img.texture = CEFowFacade.instance.fowTexture;
    }
Exemple #3
0
    public void InitAsNew(CEFowProperty _fowProperty)
    {
        mProperty = _fowProperty;

        var size = fowMapWidth * fowMapHeight;

        data = new CEFowMapData {
            exploreMapData = new bool[size], viewMapData = new bool[size]
        };

        painter = new CEFowMapPainter();
        painter.Initialize(mProperty);

        rawFowTexture          = new Texture2D(fowMapWidth, fowMapHeight, TextureFormat.RGB24, false);
        rawFowTexture.wrapMode = TextureWrapMode.Clamp;

        fowTexture = new RenderTexture(fowMapWidth, fowMapHeight, 0);

        DoInitShaderProperty();
    }