예제 #1
0
파일: CBaseMap.cs 프로젝트: zlbsy/sh109
        /// <summary>
        /// 点击地图块儿
        /// </summary>
        /// <param name="index">地图块儿索引</param>
        public virtual void OnClickTile(int index)
        {
            App.Model.Master.MBaseMap topMapMaster = BaseMapCacher.Instance.Get(mBaseMap.MapId);
            Vector2 coordinate = topMapMaster.GetCoordinateFromIndex(index);

            App.Model.MTile tile = System.Array.Find(mBaseMap.Tiles, _ => _.x == coordinate.x && _.y == coordinate.y);
            OnClickTile(tile);
        }
예제 #2
0
 /*public override void CameraTo(int id){
  *  App.Model.MTile tile = System.Array.Find(mBaseMap.Tiles, w=>w.id==id);
  *  vBaseMap.MoveToPosition(tile.x, tile.y);
  *  base.CameraTo(id);
  * }*/
 public override void OnClickTile(App.Model.MTile tile)
 {
     App.Model.Master.MArea area = tile as App.Model.Master.MArea;
     if (area != null)
     {
         Request req = Request.Create("area", area, "worldId", worldId, "nameKey", nameKey);
         App.Util.SceneManager.LoadScene(App.Util.SceneManager.Scenes.Stage.ToString(), req);
     }
 }
예제 #3
0
 /*
  * /// <summary>
  * /// 点击州府县,进入州府县场景
  * /// </summary>
  * /// <param name="index">州府县索引</param>
  * public override void OnClickTile(int index){
  *  //地图信息
  *  App.Model.Master.MBaseMap topMapMaster = BaseMapCacher.Instance.Get(mBaseMap.MapId);
  *  //根据索引获取所点击的州府县坐标
  *  Vector2 coordinate = topMapMaster.GetCoordinateFromIndex(index);
  *  //根据州府县坐标获取州府县
  *  App.Model.Master.MWorld tile = System.Array.Find(mBaseMap.Tiles, _=>_.x == coordinate.x && _.y == coordinate.y) as App.Model.Master.MWorld;
  *  OnClickTile(tile);
  * }*/
 public override void OnClickTile(App.Model.MTile tile)
 {
     App.Model.Master.MWorld world = tile as App.Model.Master.MWorld;
     if (world != null)
     {
         Request req = Request.Create("world", world);
         App.Util.SceneManager.LoadScene(App.Util.SceneManager.Scenes.Stage.ToString(), req);
         //App.Util.SceneManager.LoadScene( App.Util.SceneManager.Scenes.Area.ToString(), req );
     }
 }
예제 #4
0
파일: MTile.cs 프로젝트: zlbsy/sh109
        public static MTile Create(int tile_id, int x, int y, int level = 1)
        {
            MTile obj = new MTile();

            obj.tile_id = tile_id;
            obj.x       = x;
            obj.y       = y;
            obj.level   = level;
            obj.num     = 1;
            return(obj);
        }
예제 #5
0
        private IEnumerator Build(int buildId, VBaseMap vBaseMap, App.Model.Master.MBuilding buildingMaster)
        {
            App.Model.Master.MBaseMap topMapMaster = BaseMapCacher.Instance.Get(vBaseMap.ViewModel.MapId.Value);
            Vector2 coordinate = topMapMaster.GetCoordinateFromIndex(tileIndex);
            SShop   sShop      = new SShop();

            yield return(StartCoroutine(sShop.RequestBuyBuild(buildId, (int)coordinate.x, (int)coordinate.y)));

            App.Model.MTile        currentTile = App.Model.MTile.Create(buildingMaster.tile_id, (int)coordinate.x, (int)coordinate.y);
            List <App.Model.MTile> tileList    = vBaseMap.ViewModel.Tiles.Value.ToList();

            tileList.Add(currentTile);
            vBaseMap.ViewModel.Tiles.Value = tileList.ToArray();
            this.Close();
        }
예제 #6
0
        public override void OnClickTile(int index)
        {
            App.Model.Master.MBaseMap topMapMaster = BaseMapCacher.Instance.Get(mBaseMap.MapId);
            Vector2 coordinate = topMapMaster.GetCoordinateFromIndex(index);

            App.Model.MTile tile = System.Array.Find(mBaseMap.Tiles, _ => _.x == coordinate.x && _.y == coordinate.y);
            if (tile == null)
            {
                buildingMenu.currentIndex = index;
                OpenMenu(buildingMenu);
            }
            else
            {
                OpenMenu(strengthenMenu);
            }
        }
예제 #7
0
 public void OnClickTutorialTile()
 {
     App.Model.MTile tile = mBaseMap.Tiles[0];
     OnClickTile(tile);
 }
예제 #8
0
파일: CBaseMap.cs 프로젝트: zlbsy/sh109
 /// <summary>
 /// 点击地图块儿
 /// </summary>
 /// <param name="tile">地图块儿</param>
 public virtual void OnClickTile(App.Model.MTile tile)
 {
 }
예제 #9
0
파일: CBaseMap.cs 프로젝트: zlbsy/sh109
 public virtual void CameraTo(int id)
 {
     App.Model.MTile tile = System.Array.Find(mBaseMap.Tiles, w => w.id == id);
     vBaseMap.MoveToPosition(tile.x, tile.y);
     App.Util.LSharp.LSharpScript.Instance.Analysis();
 }