public bool SetValue( iVec2 v , _TILE value ) { return Layer.SetValue(v.X + hW, v.Y + hH, value ); }
// edit 使用 public bool SetValue( int x, int y , _TILE value ) { return Layer.SetValue(x + hW, y + hH, value ); }
public static bool IsWalkAbleTile( _TILE t ) { if ( t == _TILE._NULL || t == _TILE._RIVER|| // 河流 t == _TILE._LAKE // 湖 ) { return false; } return true; }
public bool SetValue(int x, int y, _TILE v) { if (x < 0 || x >= W || y < 0 || y >= H) return false; Tiles[x][y] = (byte)v ; return true; }
GameObject GetTileCellPrefab( int x , int y , _TILE t ) { SCENE_TILE tile = ConstDataManager.Instance.GetRow<SCENE_TILE> ((int)t); if (tile != null) { //tile.s_FILE_NAME; GameObject cell = ResourcesManager.CreatePrefabGameObj(TilePlaneObj, "Prefab/TileCell"); UISprite sprite = cell.GetComponent<UISprite>(); if( sprite != null ) { sprite.spriteName = tile.s_FILE_NAME; } UIDragObject drag = cell.GetComponent<UIDragObject>(); if( drag != null ) { drag.target = TilePlaneObj.transform ; } // tranform // float locx =0, locy =0; // Grids.GetRealXY(ref locx , ref locy , new iVec2( x , y ) ); // Vector3 pos = new Vector3( locx , locy , 0 ); if( cell != null ){ SynGridToLocalPos( cell , x, y ) ; //cell.transform.localPosition = pos; cell.name = string.Format("Cell({0},{1},{2})", x , y , 0 ); UnitCell unit = cell.GetComponent<UnitCell>() ; if( unit != null ){ unit.X( x ); unit.Y( y ); } //========================================================== UIEventListener.Get(cell).onClick += OnCellClick; // UIEventListener.Get(cell).onPress += OnCellPress; } return cell; } //_TILE._GREEN return null; }