Esempio n. 1
0
    public void SwithToLod0ByCoord(Coord c, Action successCallBack = null)
    {
        Vector3 prePos  = MapCamera.transform.localPosition;
        Vector3 lookPos = Layout.HexCenter(c);

        lookPos.y  = MapView.CameraHeightInit;
        lookPos.z -= 8f;

        Game.StartCoroutine(Lod1to0(lookPos, 30, successCallBack));
//        Game.TaskManager.Exec(Lod1to0(lookPos, 30, successCallBack));
    }
 public void ShowMarks(MapEditorEntry.EDIT_OP op, Color[] color)
 {
     if (mMarks == null)
     {
         mMarks = new SpriteRenderer[hex.xTile][];
     }
     for (int x = 0; x < hex.xTile; ++x)
     {
         if (mMarks[x] == null)
         {
             mMarks[x] = new SpriteRenderer[hex.yTile];
         }
         for (int y = 0; y < hex.yTile; ++y)
         {
             Coord c = new Coord(x + hex.xTile * xIdx, y + hex.yTile * yIdx);
             if (mapProxy == null)
             {
                 mapProxy = GameFacade.GetProxy <MapProxy>();
             }
             MapTileVO tileVo = mapProxy.GetTile(c);
             if (tileVo != null)
             {
                 int index;
                 if (op == MapEditorEntry.EDIT_OP.EDIT_AREA)
                 {
                     index = tileVo.camp;
                 }
                 else if (op == MapEditorEntry.EDIT_OP.EDIT_LV)
                 {
                     index = tileVo.level;
                 }
                 else
                 {
                     Debug.LogError("Error Op.");
                     return;
                 }
                 if (index >= color.Length)
                 {
                     Debug.LogError("No defined color of this index.");
                     return;
                 }
                 SpriteRenderer mark;
                 if (mMarks[x][y] != null)
                 {
                     mMarks[x][y].color = color[index];
                     continue;
                 }
                 mark       = GetAMark();
                 mark.color = color[index];
                 mark.transform.localPosition    = layout.HexCenter(tileVo.coord) - transform.localPosition;
                 mark.transform.localScale       = new Vector3(1.5f, 1.55f, 1f);
                 mark.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
                 mMarks[x][y] = mark;
             }
         }
     }
     markRoot.gameObject.SetActive(true);
 }
Esempio n. 3
0
    public void SyncMyCityFlagPos()
    {
        Coord c = GameFacade.GetProxy <CityProxy>().myCityCoord;

        MyCityFlag.transform.position = Layout.HexCenter(c);
    }