示例#1
0
 // Use this for initialization
 void Start()
 {
     MapCurrentX = MapNextX =  MapCurrentY = MapNextY = 0; //initiallize tile map positions
     pos = transform.position; //next x,y,z positions on inspector
     tr = transform; ////current x,y,z positions on inspector
     previusAxis = axis;
     previusDirection = direction;
     map = GetComponent<tileMap> (); //get component for tile map reading
 }
示例#2
0
    void Start()
    {
        map = GetComponent<tileMap> ();

        for (var x=0; x<17; x++)
        {
            for (var y=0; y<21; y++) {
                if (map.tiles[x,y]==0){
                    Instantiate (Resources.Load ("blTile"), new Vector3 (x, y, 0), Quaternion.identity);
                }
                else{
                    Instantiate (Resources.Load ("tile"), new Vector3 (x, y, 0), Quaternion.identity);
                }
            }
        }
    }