//	private void BtnMenu(string currBtn,int ie,bool isvel)
//	{
//		InputRoomNum.onValidate += OnInputChanged;
//		RoomNumberLabel.text = InputRoomNum.value;
//		if (isvel == true)
//			RoomNumberLabel.text = RoomNum;
//		else
//			RoomNumberLabel.text = str;
//		RoomNumberLabel.transform.parent.GetComponent<UIInput>().enabled = isvel;
//		RoomNumberLabel.transform.parent.GetComponent<BoxCollider> ().enabled = isvel;
//		BtnCreateRoom.GetComponentInChildren<UILabel>().text = currBtn;
//		for(int i = 0; i < PaneSprite.Length;i++)
//			if(TypeMap == MAPTYPE.EASYMAP && i > (int)MAPTYPE.EASYMAP)
//				PaneSprite[i].gameObject.SetActive(i == ie);
//	}
    private void StartBtnOnPress(int ie, bool press)
    {
        if (press)
        {
            return;
        }
        switch ((STATE_BTN)ie)
        {
        case STATE_BTN.BTN_CREATE_ROOM:
            CreateOrAddRoom();
            break;

        case STATE_BTN.BTN_BACK:
            //senlin
            //UILobby.Instance.OnCancel();
            break;

        case STATE_BTN.BTN_EASY:
        case STATE_BTN.BTN_HIGH:
        case STATE_BTN.BTN_MIDDLE:
            TypeMap = (MAPTYPE)(ie + TypeStart);

            break;
        }
        if ((STATE_BTN)ie == STATE_BTN.BTN_MIDDLE)
        {
            IGuideTaskManager.Instance().SendTaskEnd(EGameEvent.eGameEvent_UIGuideSelectPrimaryBtnEnd);
        }
    }
Exemplo n.º 2
0
    public IEnumerator CreateMap()
    {
        for (int row = 0; row < MAP_HIGHT; row++)
        {
            Dictionary <int, Map> mapCol = new Dictionary <int, Map>();
            for (int col = 0; col < MAP_WIDTH; col++)
            {
                //int index = Random.Range(0, 4);//random map type
                MAPTYPE type = TypeByColRow(row, col);


                Map map = this.CreatMapItem(row, col, type);
                if (map != null && !mapCol.ContainsKey(col))
                {
                    mapCol.Add(col, map);
                }
            }
            if (!this.maps.ContainsKey(row))
            {
                this.maps.Add(row, mapCol);
            }
        }
        yield return(new WaitForEndOfFrame());

        //CreateBlook();
        yield return(new WaitForEndOfFrame());

        CreateBorder();
    }
Exemplo n.º 3
0
 public override void Read()
 {
     Id              = ReadInt();
     Name            = ReadString();
     SceneName       = ReadString();
     MapType         = (MAPTYPE)ReadShort();
     NumberScene     = ReadArrayInt();
     BGMid           = ReadArrayInt();
     Suspend         = ReadInt();
     Loop            = ReadInt();
     SkyHeight       = ReadInt();
     SkyEffect       = ReadArrayInt();
     LandHeight      = ReadInt();
     GroundEffect    = ReadArrayInt();
     LockHeight      = ReadInt();
     MoveHeight      = ReadInt();
     DownHeight      = ReadInt();
     MinHeight       = ReadInt();
     TopHeight       = ReadInt();
     SkyResult       = ReadArrayInt();
     SkyResultTwo    = ReadArrayInt();
     GroundResult    = ReadArrayInt();
     GroundResultTwo = ReadArrayInt();
     FirstAttack     = ReadInt();
     GainOne         = ReadArrayInt();
     GainTwo         = ReadArrayInt();
     FirstGainBuff   = ReadArrayInt();
     AfterGainBuff   = ReadArrayInt();
 }
Exemplo n.º 4
0
 public void Parse(int col, int row, MAPTYPE type)
 {
     this.col  = col;
     this.row  = row;
     this.type = type;
     //tao cac position o day
 }
Exemplo n.º 5
0
 void SetTimeLabel(MAPTYPE _type, int ie)
 {
     BtnCancel.transform.parent.gameObject.SetActive(true);
     for (int i = 0; i < SpriteBg.Length; i++)
     {
         SpriteBg[i].gameObject.SetActive((i + 1) == ie);
     }
     type       = _type;
     isDownTime = true;
     if (CountDownTime.gameObject.activeSelf == true)
     {
         startTime = 0;
         ShowCount(CountDownTime, (int)startTime);
     }
     if (type == MAPTYPE.MIDDLEMAP)
     {
         IGuideTaskManager.Instance().SendTaskEnd(EGameEvent.eGameEvent_UIGuideMatchBtnEnd);
     }
     CGLCtrl_GameLogic.Instance.QuickBattle((int)type);
 }
Exemplo n.º 6
0
        public static string GetMapBgAudio(MAPTYPE type)
        {
            string mapName = "";

            switch (type)
            {
            case MAPTYPE.EASYMAP:
                mapName = "Audio/EnvironAudio/mus_fb_PVP004_lp_primarybattlefield";
                //mapName = MiddleMapName;
                break;

            case MAPTYPE.NEWS_GUIDE_1:
            case MAPTYPE.MIDDLEMAP:
                mapName = "Audio/EnvironAudio/mus_fb_PVP002_lp_intermediatebattlefield";
                break;

            case MAPTYPE.HIGHMAP:
                mapName = "Audio/EnvironAudio/mus_fb_PVP001_lp_seniorbattlefield";
                break;
            }
            return(mapName);
        }
Exemplo n.º 7
0
    public Map CreatMapItem(int row, int col, MAPTYPE type)
    {
        if (this.dicModel.ContainsKey(type))
        {
            MapModel model = this.dicModel[type];

            MapItem item = Instantiate(model.item) as MapItem;
            item.gameObject.SetActive(true);
            item.transform.SetParent(this.transform);
            item.transform.localScale = new Vector3(2, 2, 2);
            float down = MAP_HIGHT / 2 * SACLE;
            float left = MAP_WIDTH / 2 * SACLE;
            float x    = col * SACLE - left;
            float y    = row * SACLE - down;
            item.transform.localPosition = new Vector3(x, y);
            if (item != null)
            {
                item.Parse(col, row, type);
                Map map = new Map(row, col, item);
                return(map);
            }
        }
        return(null);
    }
    void Init()
    {
        posParent = transform.Find("Postion");
        TypeMap   = MAPTYPE.MIDDLEMAP;
        RoomTran  = posParent.Find("Mapselect");
        //获取三张图。监听
        for (int i = 0; i < RoomTran.childCount; i++)
        {
            SpriteEasyOrHigh[i] = RoomTran.Find(Coord[i]).GetComponent <ButtonOnPress>();
        }
        //获取菜单按钮。监听
        BtnCreateMenu  = posParent.Find("ModeSelect/Create").GetComponent <UIToggle>();
        BtnAddRoomMenu = posParent.Find("ModeSelect/Join").GetComponent <UIToggle>();

        //获取创建和返回按钮。监听
        BtnCreateRoom = posParent.Find("CreateButton").GetComponent <ButtonSelectPic>();
        BtnBack       = posParent.Find("BackButton").GetComponent <ButtonSelectPic>();
        //获取房间号和房间密码
        RoomNumberLabel = posParent.Find("RoomID/Label").GetComponent <UILabel>();
        InputRoomNum    = RoomNumberLabel.transform.parent.GetComponent <UIInput>();

        InputPassWord     = posParent.Find("Password").GetComponent <UIInput>();
        RoomPassWordLabel = InputPassWord.transform.Find("Label").GetComponent <UILabel>();
    }
Exemplo n.º 9
0
        public void GetMap(XML_TYPE xmltype, out List <Completion> list, MAPTYPE mapttype, IGlyphService gs, string key = null)
        {
            list = new List <Completion>();
            ImageSource ico = gs.GetGlyph(StandardGlyphGroup.GlyphKeyword, StandardGlyphItem.GlyphItemPublic);

            switch (mapttype)
            {
            case MAPTYPE.C:
            {
                foreach (KeyValuePair <string, CtrlInf> pair in m_controlMap)
                {
                    //第一个是显示的单词,第二个是插入的单词,第三个说明
                    list.Add(new Completion(pair.Key, pair.Key, pair.Value.getdes(), ico, "c"));
                }
            }
            break;

            case MAPTYPE.P:
            {
                addProToList(ref list, key, ref ico);
            }
            break;
            }
        }