Пример #1
0
    private void initializationAttributs()
    {
        int i, j;

        this.pause = false;

        this.countFrame = 0;

        this.map    = environment.getMap();
        this.width  = this.map.GetLength(0);
        this.height = this.map.GetLength(1);

        this.diameter = 2 * this.visionRange + 1;

        this.fieldOfView = new Point[this.diameter, this.diameter];
        for (i = 0; i < this.diameter; i++)
        {
            for (j = 0; j < this.diameter; j++)
            {
                this.fieldOfView[i, j] = new Point();
            }
        }
        initialiseFieldOfViewEntity();

        this.mentalMap = new int[this.width, this.height];
        initializeMentalMapEntity();

        startNode = path.nearestNode(this.map, 0, this.height);
        endNode   = path.nearestNode(this.map, this.width - 1, 0);

        this.xEntity = startNode.getX();
        this.yEntity = startNode.getY();

        this.flagMap = "random";
    }
Пример #2
0
    private void floorInitialization()
    {
        int[,] map = environment.getMap();

        float width  = map.GetLength(0);
        float height = map.GetLength(1);

        GameObject aFloor = GameObject.Find("Floor");

        aFloor.transform.localScale    = new Vector3(width, 0.1f, height);
        aFloor.transform.localPosition = new Vector3(width / 2, -0.1f, height / 2);
    }