// Use this for initialization void Start() { if (Application.isEditor) { C_Stats.ACT = 1f; } else if (Application.isMobilePlatform) { C_Stats.ACT = 1.0f; ChatGUI.addLine("MobilePlatform Spotted!"); } Get = this; ChatGUI.addLine("This Is The Path for Textures!"); ChatGUI.addLine("Put Textures folder in there, then reload everything to implement the change!"); ChatGUI.addLine(Application.persistentDataPath); ItemCreator = new ITEMS(); ITEMS.main = ItemCreator; ItemCreator.ADDITEMS(); ITEMS.main.CreateStatEnchanter(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, " Range_Enchanter", AgilityIcon); //ITEMS.main.CreateStatEnchanter(0,55,0,0,0,0,0,0,0,0,0,3,0, " Rang2", AgilityIcon); //ITEMS.main.CreateStatEnchanter(0,0,55,0,0,0,0,0,0,0,0,3,0, " Rang3r", AgilityIcon); Add_items = add; les = GetComponent <LoadExternalAsSprite>(); StartCoroutine(load_items()); }
private Sprite LoadIcon(string path, int id) { //WWW w = new WWW("file://" + Application.persistentDataPath + InGameData.Sprite_path + path + ".png"); Texture2D source = LoadExternalAsSprite.GetTexture(id); if (!path.Contains("oversize")) { int c = 6; int r = 0; if (path.Contains("bow")) { c = 3; r = 6; return(Sprite.Create(source, new Rect(64 * r, c * 64, 64, 64), new Vector2(0.5f, 0.5f))); } else if (path.Contains("arrows")) { c = 3; r = 2; return(Sprite.Create(source, new Rect(64 * r, c * 64, 64 * 0.75f, 64 * 0.75f), new Vector2(0.5f, 0.5f))); } else if (path.Contains("spear")) { c = 11; r = 1; return(Sprite.Create(source, new Rect(64 * r + 5, c * 64 + 5, 64, 64 * 0.66f), new Vector2(0.5f, 0.5f))); } else if (path.Contains("feet")) { return(Sprite.Create(source, new Rect(64 * r + 5, c * 64 - 5, 64 * 0.85f, 64 * 0.55f), new Vector2(0.5f, 0.5f))); } else if (path.Contains("wings")) { c = 8; r = 0; return(Sprite.Create(source, new Rect(64 * r + 5, c * 64 + 3, 64 * 0.8f, 64 * 0.8f), new Vector2(0.5f, 0.5f))); } else if (path.Contains("dagger") || path.Contains("wand")) { c = 6; r = 2; return(Sprite.Create(source, new Rect(64 * r + 10, c * 64 + 5, 64 * 0.55f, 64 * 0.55f), new Vector2(0.5f, 0.5f))); } return(Sprite.Create(source, new Rect(64 * r + 10, c * 64 + 5, 64 * 0.65f, 64 * 0.65f), new Vector2(0.5f, 0.5f))); } else { int c = 1; int r = 2; if (path.Contains("spear")) { c = 2; r = 0; return(Sprite.Create(source, new Rect(r * 192, c * 192 + 50, 162, 192 / 3), new Vector2(0.5f, 0.5f))); } return(Sprite.Create(source, new Rect(r * 192 + 50, c * 192 + 50, 192 / 3, 192 / 3), new Vector2(0.5f, 0.5f))); } }
IEnumerator Start() { while (DataBase.LoadedSpritesDataBase == null) { yield return(new WaitForSeconds(Time.deltaTime * 2)); } LES = DataBase.LoadedSpritesDataBase; Parent = transform.parent.GetComponent <AddSpriteN>(); sr = GetComponent <SpriteRenderer>(); sr.sortingLayerName = "all"; loaded = true; }
IEnumerator Reload() { yield return(new WaitForSeconds(1f)); LoadExternal.main.reLoadData(); ChatGUI.addLine("Reloading Game in..."); yield return(new WaitForSeconds(1f)); LoadExternalAsSprite.ReloadDataBase(); for (int i = 10; i > 0; i--) { ChatGUI.addLine(i.ToString() + "..."); yield return(new WaitForSeconds(0.25f)); } SceneManager.LoadScene(1); }
private bool LoadSprites(int id) { LES = DataBase.LoadedSpritesDataBase; if (LES == null) { return(false); } Parent = transform.parent.GetComponent <AddSpriteN>(); sr = GetComponent <SpriteRenderer>(); sr.sortingLayerName = "all"; StartCoroutine(getTexture(id)); Destroy(source); return(true); }
// Use this for initialization void Start() { print("ExternalLoad - " + (ExternalLoad == this)); ExternalLoad = this; print("ExternalLoad - " + (ExternalLoad == this)); if (LoadAll) { LoadAllSprites(SpriteGender.male); } if (LoadAllBodyParts) { LoadBodyParts(SpriteGender.male); } DataBase.LoadedSpritesDataBase = this; CreateIDtP(); JumpId = new int[maxT]; for (int i = 0; i < maxT; i++) { StartCoroutine(LoadSprites_delayed(i)); JumpId[i] = 0; } print(ThreadCount_visual_editor); ThreadCount = 1; //StartCoroutine(LoadSprites_delayed(1)); //StartCoroutine(LoadSprites_delayed(2)); //StartCoroutine(LoadSprites_delayed(3)); //StartCoroutine(LoadSprites_delayed(4)); StartCoroutine(DelOrder()); }