Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
    // 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;
    }
Esempio n. 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();
    }