//This function sets character animations public void setAnimation(int characterId, string animationName) { //Getting character int characterIndex = findBattleManagerCharactersIndexById(characterId); characterInfo character = BattleManager.core.characters[characterIndex]; //Setting animation character.currentAnimation = animationName; }
void Set_ViewCharacter() { User_Units _userUnit = null; infos_unit _infoUnit = null; if (user.User_Units.ContainsKey(nowSelectUnitIdx)) { _userUnit = user.User_Units[nowSelectUnitIdx]; } if (TableDataManager.instance.Infos_units.ContainsKey(nowSelectUnitIdx)) { _infoUnit = TableDataManager.instance.Infos_units[nowSelectUnitIdx]; } if (viewCharacter == null) { if (_userUnit != null) { //선택한 캐릭터 생성 Transform unitTr = ObjectPoolManager.Getinstance.Get_ObjectLobbyUnit(nowSelectUnitIdx.ToString()); unitTr.transform.parent = viewCharacterParentTr; unitTr.transform.localPosition = new Vector3(0, 0, 500f); unitTr.transform.localRotation = Quaternion.Euler(new Vector3(0, 180, 0)); unitTr.transform.localScale = new Vector3(225.0f, 225.0f, 225.0f); // 크기 225로 잡기 characterInfo lc = unitTr.GetComponent <characterInfo>(); //캐릭 초기화 lc.Init_chrctBasicInfo(_userUnit, _infoUnit); //회전관련 값 할당 CharRotateSector.Init_RotateSector(unitTr); //생성된캐릭 할당 viewCharacter = lc; } } else { //소유중인 유닛이면 //if (_userUnit != null) { // characterInfo 갱신위한 파라미터 재할당 viewCharacter.Refresh_ChrctInfo(_userUnit, _infoUnit); } } //배치값 Text_BatchNum.text = user.GetBatchTxt(user.User_useUnit.nowSelectBatch); }
public string buildLuaString(string indent) { string indent2 = indent + "\t\t"; StringBuilder luaString = new StringBuilder(indent + "[" + fontSize + "] = {\n"); luaString.Append(indent + "\tlineHeight = " + this.lineHeight + ";").AppendLine(); luaString.Append(indent + "\tfirstAdjust = " + this.firstAdjust + ";").AppendLine(); luaString.Append(indent + "\tcharacters = {").AppendLine(); // build characters foreach (KeyValuePair <char, characterInfo> kvp in characters) { characterInfo cinfo = kvp.Value; luaString.Append(indent2 + "[" + (byte)cinfo.character + "] = {"); luaString.AppendFormat("xadvance = {0}, ", cinfo.xadvance); luaString.AppendFormat("x = {0}, ", cinfo.x); luaString.AppendFormat("y = {0}, ", cinfo.y); luaString.AppendFormat("yoffset = {0}, ", cinfo.yoffset); luaString.AppendFormat("width = {0}, ", cinfo.width); luaString.AppendFormat("height = {0}, ", cinfo.height); luaString.AppendFormat("atlas = {0}", cinfo.atlas); luaString.Append("};").AppendLine(); } luaString.Append(indent + "\t};\n" + indent + "\tkerning = {\n"); // build kerning foreach (KeyValuePair <char, Dictionary <char, kerningInfo> > kvp in kerning) { luaString.Append(indent2 + "[" + (byte)kvp.Key + "] = {\n"); foreach (KeyValuePair <char, kerningInfo> kvp2 in kvp.Value) { luaString.Append(indent2 + "\t[" + (byte)kvp2.Key + "] = {"); luaString.AppendFormat("kernx = {0}, ", kvp2.Value.kernx); luaString.AppendFormat("kerny = {0}", kvp2.Value.kerny); luaString.Append("};").AppendLine(); } luaString.Append(indent2 + "};").AppendLine(); } luaString.Append(indent + "\t" + "};\n" + indent + "};"); return(luaString.ToString()); }
public void OnTriggerEnter(Collider coll) { if (coll.tag == "ChacterSelecting") { //이전선택 캐릭터 크기 줄이자 if (Lst_selectedChar.Count > 0) { SetScale_WhenUnselected(Lst_selectedChar.Dequeue()); } // 현재 선택캐릭터 큐담기 Lst_selectedChar.Enqueue(coll); if (OrinScale == Vector3.zero) { OrinScale = coll.transform.localScale; } if (Que_routineSize.Count > 0) { StopCoroutine(Que_routineSize.Dequeue()); } //현재 선택된캐릭터 크기키우기 Coroutine routine = StartCoroutine(routine_LerpScaleUpObject(coll, SelectingScale, 4f)); Que_routineSize.Enqueue(routine); //선택 되었다 그다음행동~ characterInfo cInfo = coll.GetComponent <characterInfo>(); UI_LobbyOld.Getsingleton.Apply_LobbyInfoUsingSelectedChar(cInfo); //선택된 캐릭터가 세트이펙트 활성여부 cInfo.Chk_EquipSetBuf(true); //소유캐릭정보UI 재 활성화 ..에니메이션 재발동을위해 UI_LobbyOld.Getsingleton.On_reActiveUnlockInfo(); } }
public void addCharacter(char character, characterInfo charInfo) { characters.Add(character, charInfo); }
public void AddList_Character(characterInfo unitObj) { characters.Add(unitObj); }
//선택한 캐릭터의한 로비정보 적용 public void Apply_LobbyInfoUsingSelectedChar(characterInfo selectChar) { //캐릭터 선택 ...캐릭인덱스저장 User _user = UserDataManager.instance.user; _user.User_useUnit.UnitIdx = selectChar.unitInfos.UnitIdx; if (selectChar.isHave) { // 소유캐릭터정보 오브젝트 활성화 Active_unlockInfo(true); //계급으로 초보자버튼 활성/비활성 if (selectChar.userUnit.UnitRk < 3) //상병 미만이면 활성 { Activate_publicLobbyObj(EumLobbyObj.BeginnerGameBtn, true); } else { Activate_publicLobbyObj(EumLobbyObj.BeginnerGameBtn, false); } // 선택된 소유캐릭터 정보 넣기 Dictionary <byte, Infos_UnitRank> _dicUnitRank = TableDataManager.instance.Infos_unitRanks; //계급 image_UnitRank.sprite = ImageManager.instance.Get_Sprite(string.Format("{0}{1}", DefineKey.unitrank, selectChar.userUnit.UnitRk)); //현재무기 image_UnitWeapon.sprite = ImageManager.instance.Get_Sprite(_user.User_Units[_user.User_useUnit.UnitIdx].MainWpnIdx.ToString()); //경험치 byte curRk = (byte)selectChar.userUnit.UnitRk; byte nextRk = (byte)(selectChar.userUnit.UnitRk + 1); if (_dicUnitRank.ContainsKey(nextRk)) { float nowExp = 0; float nextNeedExp = 0; //지금획득경험치 if (curRk == 1) { nowExp = (float)selectChar.userUnit.UnitExp; } else { nowExp = (float)(selectChar.userUnit.UnitExp - _dicUnitRank[curRk].NeedExp); } //다음필요경험치 nextNeedExp = _dicUnitRank[nextRk].NeedExp - _dicUnitRank[curRk].NeedExp; text_UnitExp.text = string.Format("{0}/{1}", selectChar.userUnit.UnitExp, _dicUnitRank[nextRk].NeedExp); slider_unitExp.maxValue = nextNeedExp; slider_unitExp.value = nowExp; } //레벨 text_UnitLv.text = string.Format("LV.{0}", selectChar.userUnit.RefLv); if (selectChar.userUnit.RefLv < 15) { text_LvInfo.text = "UPGRADE"; } else { text_LvInfo.text = "MAX"; } //킬데스 if (_user.User_unit_useInfos.ContainsKey(_user.User_useUnit.UnitIdx)) { uint death = _user.User_unit_useInfos[_user.User_useUnit.UnitIdx].DeathCnt; if (death == 0) { death = 1; } float kdRate = (float)(_user.User_unit_useInfos[_user.User_useUnit.UnitIdx].KillCnt) / (float)(death); text_UnitKD.text = string.Format("{0}", kdRate.ToString("N3")); } else { text_UnitKD.text = string.Format("0.000"); } //능력치 float initHp = selectChar.unitInfos.Hp; float initMv = selectChar.unitInfos.MvSpeed; int reflv = selectChar.userUnit.RefLv; Lst_textUnitName[0].text = selectChar.unitInfos.UnitName; Lst_imageMainSkill[0].sprite = ImageManager.instance.Get_Sprite(string.Format("{0}{1}", DefineKey.lobbySkill, (int)selectChar.unitInfos.SkillKind)); Lst_textHp[0].text = ((int)StaticMethod.Get_nextSpec(initHp, reflv, true)).ToString(); if (reflv > 4) //강화렙 5이상 시 { Lst_textmoveSpeed[0].text = (StaticMethod.Get_nextSpec(initMv, reflv, false, 0.05f, 4)).ToString(); } else { Lst_textmoveSpeed[0].text = selectChar.unitInfos.MvSpeed.ToString(); } if (reflv > 9) //강화렙 10 이상시 { Lst_textReloadSpeed[0].text = "+" + Mathf.Abs((int)StaticMethod.Get_nextSpec(0f, reflv, true, 5f, 9)).ToString(); } else { Lst_textReloadSpeed[0].text = "+" + selectChar.unitInfos.RldSpeed.ToString(); } if (selectChar.userUnit.SubSkill != 0) { Lst_textSubSkill[0].text = TableDataManager.instance.Infos_Skills[selectChar.userUnit.SubSkill].SkillName; } else { Lst_textSubSkill[0].text = "-----"; } } else { // 비소유캐릭터정보 오브젝트 비활성화 Active_unlockInfo(false); //선택된 미소유캐릭터 정보 넣기 //설명 text_Descrip.text = TextDataManager.Dic_TranslateText[(int)selectChar.unitInfos.UnitIdx]; //가격 if (isSelectMode) { text_buyPrice.text = "0"; } else { text_buyPrice.text = selectChar.unitInfos.SellItNum.ToString(); } //구매이미지 if (selectChar.unitInfos.SellItTp == ITEMTYPE.GEM) { image_buyType.sprite = ImageManager.instance.Get_Sprite(DefineKey.Gem); } else if (selectChar.unitInfos.SellItTp == ITEMTYPE.GOLD) { image_buyType.sprite = ImageManager.instance.Get_Sprite(DefineKey.Gold); } //비소유시 능력치 Lst_textUnitName[1].text = selectChar.unitInfos.UnitName; //스킬이미지 Lst_imageMainSkill[1].sprite = ImageManager.instance.Get_Sprite(string.Format("{0}{1}", DefineKey.lobbySkill, (int)selectChar.unitInfos.SkillKind)); Lst_textHp[1].text = selectChar.unitInfos.Hp.ToString(); Lst_textmoveSpeed[1].text = selectChar.unitInfos.MvSpeed.ToString(); Lst_textReloadSpeed[1].text = "+" + selectChar.unitInfos.RldSpeed.ToString(); Lst_textSubSkill[1].text = "-----"; } //for (int i = 0; i < Lst_LobbyCharacters.Count; i++) //{ // if (Lst_LobbyCharacters[i] != selectChar) // Lst_LobbyCharacters[i].Set_lockObj(false); //} }