public FogOfWarData GetData()
    {
        var data = new FogOfWarData();

        // data.shadowMap = shadowMap;
        data.pixels = pixels;
        data.interpolateStartFrame = interpolateStartFrame;
        // data.lastShadowMap = lastShadowMap;

        return(data);
    }
Esempio n. 2
0
    public void init(int x, int z, float size, int resolution, Color[][] color, Texture2D text)
    {
        size_x         = x;
        size_z         = z;
        tileSize       = size;
        tileResolution = resolution;
        tiles          = color;
        texture        = text;

        col = GetComponent <Collider> ();
        map = new FogOfWarData(size_x, size_z);
        BuildMesh();
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        player = GameObject.Find("Player");
        col    = GetComponent <Collider> ();
        map    = new DataTileMap(size_x, size_z, !fogOfWar);
        BuildMesh();
        if (fogOfWar)
        {
            gbfog = Instantiate(Resources.Load("FogOfWar/FogOfWar"),
                                new Vector3(0, 0.1f, 0),
                                Quaternion.identity) as GameObject;
            fog = gbfog.GetComponent <FogOfWar> ();
            fog.init(size_x, size_z, tileSize, tileResolution, tiles, terrainTiles);
            datafog = fog.getMap();
        }

        SpawnAvatar();
        addInputManager();
        //makeBlockingTile ();
        Spawn();

        MakeObstacle();
    }
 public void SetData(FogOfWarData data)
 {
     pixels = data.pixels;
     interpolateStartFrame = data.interpolateStartFrame;
 }