public void ReDraw() { var text = GetComponent <Text>(); if (text != null) { if (User.language == "en") { text.GetComponent <Text>().font = Resources.Load <Font>("Font/en"); } else { text.GetComponent <Text>().font = Resources.Load <Font>("Font/ko"); } if (KEY_NAME == "ISOCode") { text.text = LocalizationManager.GetLanguage(); } else { try { text.text = LocalizationManager.Fields[KEY_NAME]; } catch (KeyNotFoundException e) { Debugging.LogWarning(KEY_NAME + " 의 로컬라이징 텍스트를 발견하지못함"); } } } }
private void OnTriggerEnter2D(Collider2D collision) { if (!isDead) { try { if (collision.gameObject.CompareTag("bullet") && !isUnBeat && collision.GetComponent <bulletController>() != null && collision.GetComponent <bulletController>().isAlly != isPlayerCastle && collision.GetComponent <bulletController>().Target.GetInstanceID() == this.transform.GetInstanceID()) { collision.GetComponent <bulletController>().BulletStand(this.transform); } if (collision.gameObject.CompareTag("arrow") && !isUnBeat && collision.GetComponent <arrowController>() != null && collision.GetComponent <arrowController>().isAlly != isPlayerCastle && !collision.GetComponent <arrowController>().isStand&& collision.GetComponent <arrowController>().target.transform.GetInstanceID() == this.transform.GetInstanceID()) { collision.GetComponent <arrowController>().ArrowStand(this.transform); } if (collision.gameObject.layer == 9 && collision.GetComponent <Collider2D>() != null && collision.isTrigger && !isUnBeat && collision.GetComponentInParent <Hero>() != null && collision.GetComponentInParent <Hero>().isPlayerHero != isPlayerCastle && collision.GetComponentInParent <Hero>().target.transform.GetInstanceID() == this.transform.GetInstanceID()) { Hitted(collision, collision.GetComponentInParent <Hero>().Damage(), 3f, 3f); } } catch (NullReferenceException e) { Debugging.LogWarning(e.ToString()); } } }
public static void SetHero(Hero heroPrefab) { HeroData heroData = userHeros.Find(hero => hero.id == heroPrefab.id || hero.id.Equals(heroPrefab.id)); if (heroData != null) { heroData.level = heroPrefab.status.level; heroData.exp = heroPrefab.status.exp; } else { Debugging.LogWarning("세팅할 영웅을 찾지못함 >> " + heroPrefab.id); } }
public void TimeLineStart(int timelinenumber) { if (timelineInterfaces[status.stageNumber].Timelines[timelinenumber] != null) { Common.GetCameraObject().GetComponent <CinemachineBrain>().enabled = true; timelineInterfaces[status.stageNumber].Timelines[timelinenumber].SetActive(true); timelineInterfaces[status.stageNumber].Timelines[timelinenumber].GetComponent <PlayableDirector>().Play(); Debugging.Log(status.stageNumber + " 스테이지의 " + timelinenumber + " 타임라인을 실행합니다."); } else { Debugging.LogWarning(status.stageNumber + " 스테이지의 " + timelinenumber + " 타임라인이 존재하지 않습니다."); } }
public static void MapClear(int mapId, int clearPoint = 1) { Map clearMap = userMaps.Find(map => map.id == (mapId) || map.id.Equals(mapId)); Map openMap = maps.Find(map => map.id == (mapId + 1) || map.id.Equals(mapId + 1)); if (clearMap != null) { clearMap.clearPoint = clearPoint; if (openMap != null) { userMaps.Add(openMap); } MapDatabase.AddMapClear(clearMap.id, openMap.id); } else { Debugging.LogWarning("클리어 할 맵을 찾지못함 >> " + mapId); } }
public GameObject GetHeroPrefab(int id) { if (heroPrefabList != null) { foreach (var hero in heroPrefabList) { if (hero.GetComponent <Hero>().id == id) { return(hero); } } Debugging.LogWarning(heroPrefabList.Count + " 의 영웅 프리팹 준비됨. >> " + id + " 의 영웅 프리팹을 찾을 수 없음."); return(null); } else { Debugging.LogWarning("heroPrefabList가 없음."); return(null); } }
public GameObject GetMonsterPrefab(int id) { if (monsterPrefabList != null) { foreach (var monster in monsterPrefabList) { if (monster.GetComponent <Hero>().id == id) { return(monster); } } Debugging.LogWarning(monsterPrefabList.Count + " 의 몬스터 프리팹 준비됨. >> " + id + " 의 몬스터 프리팹을 찾을 수 없음."); return(null); } else { Debugging.LogWarning("monsterPrefabList 가 없음."); return(null); } }
public GameObject GetCastlePrefab(int id) { if (castlePrefabList != null) { foreach (var castle in castlePrefabList) { if (castle.GetComponent <Castle>().id == id) { return(castle); } } Debugging.LogWarning(castlePrefabList.Count + " 의 캐슬 프리팹 준비됨. >> " + id + " 의 캐슬 프리팹을 찾을 수 없음."); return(null); } else { Debugging.LogWarning("castlePrefabList 없음."); return(null); } }
public static string GetText(string key) { string txt = ""; if (key == "ISOCode") { txt = LocalizationManager.GetLanguage(); } else { try { txt = LocalizationManager.Fields[key]; } catch (KeyNotFoundException e) { Debugging.LogWarning(key + " 의 로컬라이징 텍스트를 발견하지못함"); } } return(txt); }
public static bool UseItem(int id, int count) { Item useItem = userItems.Find(item => item.customId == id || item.customId.Equals(id)); Debugging.Log("#2 >>" + useItem.name + "#" + useItem.customId + "#" + useItem.id); if (useItem != null) { if (useItem.count - count <= 0) { //xml삭제 userItems.Remove(useItem); if (useItem.itemtype == 0) { ItemDatabase.DeleteEquipItemSave(useItem.customId); } else { ItemDatabase.DeleteItemSave(useItem.id); } Debugging.Log(useItem.name + "을 " + count + "개 사용하여 0개가 남아서 XML에서 삭제되었습니다."); return(true); } else { useItem.count -= count; ItemDatabase.ItemSave(useItem.id); Debugging.Log(useItem.name + "을 " + count + "개 사용하여 " + useItem.count + "개 남았습니다."); return(true); } } else { Debugging.LogWarning(id + " 아이템이 NULL 입니다."); return(false); } }