Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
[RequireComponent(typeof(MeshFilter)), RequireComponent(typeof(MeshRenderer))]
public class MapCreator : MonoBehaviour
{
public GameObject LadderTop;
public GameObject LadderTop2;
public MapHandler MH;
public GameObject LightHousePrefab;
public GameObject LightHousePrefab1;
public GameObject Leaves;
private GameObject[] TileMaker;
public GameObject TileMakerPrefab;
private static int Animations = 147;
private GameObject[] AniWaterLayer = new GameObject[MapCreator.Animations * 4];
public GameObject[] AniWaterPrefab;
public GameObject[] Turbines;
public GameObject[] EnviromentalSounds;
public GameObject[] StairPrefab;
public GameObject TreePrefab;
public GameObject RockPrefab;
public GameObject LinkPrefab;
public GameObject AniDoorPrefab;
public GameObject AniDoubleDoorPrefab;
public GameObject StoreDoor;
public GameObject GymDoor;
public GameObject GameLight;
public GameObject Lab1;
public GameObject Lab2;
public GameObject FireLight;
public GameObject PokeFloor;
public GameObject EffectLight;
public GameObject[] Lights;
public GameObject PokeCenterLight;
public GameObject SkullLight1;
public GameObject SkullLight2;
public GameObject TowerFog;
public GameObject SandStorm;
public int Width;
public int Height;
public bool outside;
public string Song;
public int[,] Tiles;
public int[,] Tiles2;
public int[,] Tiles3;
public int[,] Tiles4;
public int[,] Colliders;
public int[,] Links;
public string mapName;
public int dimensionY;
public int dimensionX;
public int a;
public bool loading;
public bool dark;
public string MapWeather;
public float OverLap = 0.0001f;
private DSSock Socket;
private LoadGame Loader;
public string region;
public string npcString = string.Empty;
private byte Quality;
public UILabel MapLabel;
public List<Vector3>[] newVertices;
public List<int>[] newTriangles;
public List<Vector2>[] newUV;
public List<Vector3>[] newVertices2;
public List<int>[] newTriangles2;
public List<Vector2>[] newUV2;
public List<Vector3>[] newVertices3;
public List<int>[] newTriangles3;
public List<Vector2>[] newUV3;
public List<Vector3>[] newVertices4;
public List<int>[] newTriangles4;
public List<Vector2>[] newUV4;
public int[] newCount1;
public int[] newCount2;
public int[] newCount3;
public int[] newCount4;
private Mesh mesh;
private void Start()
{
this.Socket = GameObject.Find("Socket").GetComponent<DSSock>();
if (GameObject.Find("GameLoader"))
{
this.Loader = GameObject.Find("GameLoader").GetComponent<LoadGame>();
if (!this.Loader.Bundle)
{
this.Socket.con.Add("PRO> Using Local Resources.");
}
else
{
this.Socket.con.Add("PRO> Using Bundled Resources.");
}
}
}
public void DestroyMap()
{
GameObject[] array = GameObject.FindGameObjectsWithTag("Tile");
GameObject[] array2 = array;
for (int i = 0; i < array2.Length; i++)
{
GameObject obj = array2[i];
UnityEngine.Object.Destroy(obj);
}
}
public void loadMap()
{
if (PlayerPrefs.GetInt("LightQuality", 1) == 1)
{
this.EffectLight = this.Lights[0];
this.Quality = 1;
}
else
{
this.EffectLight = this.Lights[1];
this.Quality = 2;
}
this.Leaves.SetActive(false);
this.dark = false;
this.loading = true;
this.DestroyMap();
this.outside = true;
this.npcString = string.Empty;
TextAsset textAsset;
if (!this.Loader)
{
textAsset = (Resources.Load("Maps/" + this.mapName) as TextAsset);
}
else if (this.Loader.Bundle)
{
textAsset = (this.Loader.Bundle.LoadAsset(this.mapName) as TextAsset);
}
else
{
textAsset = (Resources.Load("Maps/" + this.mapName) as TextAsset);
}
Stream input = new MemoryStream(textAsset.bytes);
BinaryReader binaryReader = new BinaryReader(input);
if (binaryReader.PeekChar() != -1)
{
if (binaryReader.ReadInt16() == 2)
{
int num = binaryReader.ReadInt32();
binaryReader.ReadInt32();
int num2 = binaryReader.ReadInt32();
binaryReader.ReadInt32();
this.dimensionY = num;
this.dimensionX = num2;
this.Width = num2 - 1;
this.Height = num - 1;
this.Colliders = new int[this.dimensionX, this.dimensionY];
this.Links = new int[this.dimensionX, this.dimensionY];
for (int i = 0; i < this.dimensionY; i++)
{
for (int j = 0; j < this.dimensionX; j++)
{
this.Colliders[j, i] = (int)binaryReader.ReadInt16();
}
}
}
if (binaryReader.ReadInt16() == 2)
{
int num = binaryReader.ReadInt32();
binaryReader.ReadInt32();
int num2 = binaryReader.ReadInt32();
binaryReader.ReadInt32();
this.dimensionY = num;
this.dimensionX = num2;
this.Tiles = new int[this.dimensionX, this.dimensionY];
for (int i = 0; i < this.dimensionY; i++)
{
for (int j = 0; j < this.dimensionX; j++)
{
this.Tiles[j, i] = (int)binaryReader.ReadInt16();
if (this.Tiles[j, i] < 0)
{
this.Tiles[j, i] = -this.Tiles[j, i] + 32767;
}
}
}
}
if (binaryReader.ReadInt16() == 2)
{
int num = binaryReader.ReadInt32();
binaryReader.ReadInt32();
int num2 = binaryReader.ReadInt32();
binaryReader.ReadInt32();
this.dimensionY = num;
this.dimensionX = num2;
this.Tiles2 = new int[this.dimensionX, this.dimensionY];
for (int i = 0; i < this.dimensionY; i++)
{
for (int j = 0; j < this.dimensionX; j++)
{
this.Tiles2[j, i] = (int)binaryReader.ReadInt16();
if (this.Tiles2[j, i] < 0)
{
this.Tiles2[j, i] = -this.Tiles2[j, i] + 32767;
}
}
}
}
if (binaryReader.ReadInt16() == 2)
{
int num = binaryReader.ReadInt32();
binaryReader.ReadInt32();
int num2 = binaryReader.ReadInt32();
binaryReader.ReadInt32();
this.dimensionY = num;
this.dimensionX = num2;
this.Tiles3 = new int[this.dimensionX, this.dimensionY];
for (int i = 0; i < this.dimensionY; i++)
{
for (int j = 0; j < this.dimensionX; j++)
{
this.Tiles3[j, i] = (int)binaryReader.ReadInt16();
if (this.Tiles3[j, i] < 0)
{
this.Tiles3[j, i] = -this.Tiles3[j, i] + 32767;
}
}
}
}
if (binaryReader.ReadInt16() == 2)
{
int num = binaryReader.ReadInt32();
binaryReader.ReadInt32();
int num2 = binaryReader.ReadInt32();
binaryReader.ReadInt32();
this.dimensionY = num;
this.dimensionX = num2;
this.Tiles4 = new int[this.dimensionX, this.dimensionY];
for (int i = 0; i < this.dimensionY; i++)
{
for (int j = 0; j < this.dimensionX; j++)
{
this.Tiles4[j, i] = (int)binaryReader.ReadInt16();
if (this.Tiles4[j, i] < 0)
{
this.Tiles4[j, i] = -this.Tiles4[j, i] + 32767;
}
}
}
}
int count = (int)binaryReader.ReadInt16();
this.MapWeather = new string(binaryReader.ReadChars(count));
if (this.MapWeather != "None" && this.MapWeather != "Rain" && this.MapWeather != "Snow" && this.MapWeather != "Tower Fog" && this.MapWeather != "Sandstorm" && this.MapWeather != "Drought" && this.MapWeather != "FlashDark" && this.MapWeather != "Leaves")
{
this.MapWeather = "None";
}
if (this.MapWeather != "None")
{
this.Socket.Rain.SetActive(false);
this.Socket.Snow.SetActive(false);
this.Socket.Draught.SetActive(false);
this.SandStorm.SetActive(false);
}
binaryReader.ReadInt16();
binaryReader.ReadInt16();
if (binaryReader.ReadByte() == 0)
{
this.outside = false;
}
count = (int)binaryReader.ReadInt16();
this.region = new string(binaryReader.ReadChars(count));
binaryReader.ReadInt16();
int num3 = (int)(binaryReader.ReadInt16() - 1);
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
for (int k = 0; k < num3; k++)
{
count = (int)binaryReader.ReadInt16();
binaryReader.ReadChars(count);
this.Links[(int)binaryReader.ReadInt16(), (int)binaryReader.ReadInt16()] = 1;
binaryReader.ReadInt16();
binaryReader.ReadInt16();
}
binaryReader.ReadInt16();
int num4 = (int)(binaryReader.ReadInt16() - 1);
for (int l = 0; l < 45; l++)
{
binaryReader.ReadInt16();
}
for (int m = 0; m < num4; m++)
{
count = (int)binaryReader.ReadInt16();
string str = new string(binaryReader.ReadChars(count));
this.npcString = this.npcString + this.mapName + "|";
this.npcString = this.npcString + binaryReader.ReadInt16().ToString() + "|";
this.npcString = this.npcString + binaryReader.ReadInt16().ToString() + "|";
this.npcString = this.npcString + binaryReader.ReadByte().ToString() + "|";
byte b = binaryReader.ReadByte();
this.npcString = this.npcString + binaryReader.ReadInt16().ToString() + "|";
this.npcString = this.npcString + str + "|";
count = (int)binaryReader.ReadInt16();
binaryReader.ReadChars(count);
count = (int)binaryReader.ReadInt16();
string str2 = new string(binaryReader.ReadChars(count));
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
if (binaryReader.ReadInt16() == 0)
{
this.npcString += "N|";
}
else
{
this.npcString += "Y|";
}
binaryReader.ReadInt16();
binaryReader.ReadSingle();
binaryReader.ReadSingle();
this.npcString = this.npcString + binaryReader.ReadInt16().ToString() + "|";
this.npcString = this.npcString + b.ToString() + "|";
this.npcString += "0|";
this.npcString = this.npcString + str2 + "*";
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
binaryReader.ReadInt16();
}
}
if (binaryReader != null)
{
((IDisposable)binaryReader).Dispose();
}
this.MapLabel.text = this.mapName;
this.createTest();
this.loading = false;
this.Leaves.SetActive(false);
if (this.mapName.ToLower() == "viridian forest")
{
this.Leaves.SetActive(true);
this.MapWeather = "Leaves";
}
else if (this.mapName.ToLower() == "love island")
{
this.Leaves.SetActive(true);
this.MapWeather = "Leaves";
}
else if (this.mapName.ToLower() == "safari exclusive")
{
this.Leaves.SetActive(true);
this.MapWeather = "Leaves";
}
else if (this.mapName.ToLower() == "start")
{
this.Leaves.SetActive(true);
this.MapWeather = "Leaves";
}
if (this.MapWeather == "Leaves")
{
this.Leaves.SetActive(true);
}
this.MH.PlayerPosition(this.mapName);
this.Socket.NPCLock = false;
if (this.Socket.CanMove)
{
int num5 = this.Socket.NPCLOS(0);
if (num5 > 0)
{
this.Socket.NPCLock = false;
if (this.Socket.inBattle)
{
return;
}
this.Socket.LockPlayer();
cNPC component = this.Socket.NPCS[num5 - 1].GetComponent<cNPC>();
component.waitmove = -100f;
component.QUE.Clear();
component.SetLOSActive(this.Socket.NPCVect);
}
}
Resources.UnloadUnusedAssets();
}
public void destroyTree(int x, int y)
{
GameObject[] array = GameObject.FindGameObjectsWithTag("MapEffects");
GameObject[] array2 = array;
for (int i = 0; i < array2.Length; i++)
{
GameObject gameObject = array2[i];
if (gameObject.transform.position.x == (float)x && gameObject.transform.position.y == (float)(-(float)y))
{
UnityEngine.Object.Destroy(gameObject);
return;
}
}
}
public void destroyRock(int x, int y)
{
GameObject[] array = GameObject.FindGameObjectsWithTag("MapEffects");
GameObject[] array2 = array;
for (int i = 0; i < array2.Length; i++)
{
GameObject gameObject = array2[i];
if (gameObject.transform.position.x == (float)x && gameObject.transform.position.y == (float)(-(float)y))
{
DestroyRock component = gameObject.GetComponent<DestroyRock>();
component.RemoveMe();
return;
}
}
}
public void DestroyTotalMap()
{
this.DestroyMap();
if (this.TileMaker != null)
{
for (int i = 0; i < this.TileMaker.Length; i++)
{
UnityEngine.Object.Destroy(this.TileMaker[i]);
}
}
GameObject[] array = GameObject.FindGameObjectsWithTag("MapEffects");
GameObject[] array2 = array;
for (int j = 0; j < array2.Length; j++)
{
GameObject obj = array2[j];
UnityEngine.Object.Destroy(obj);
}
}
private void FixedUpdate()
{
if (Time.timeScale == 0f)
{
return;
}
if (Time.timeScale != 1f || this.Socket.SaySpeed > 150f || PlayerPrefs.GetFloat("DANMENUMAINPOSX", 0f) != 0f)
{
Time.timeScale = 1f;
if (this.Socket.LoggedIn)
{
this.Socket.sendPacket("btt");
}
}
}
public void createTest()
{
if (this.TileMaker != null)
{
for (int i = 0; i < this.TileMaker.Length; i++)
{
UnityEngine.Object.Destroy(this.TileMaker[i]);
}
}
for (int j = 0; j < MapCreator.Animations; j++)
{
if (this.AniWaterLayer[j * 4] != null)
{
UnityEngine.Object.Destroy(this.AniWaterLayer[j * 4]);
}
if (this.AniWaterLayer[j * 4 + 1] != null)
{
UnityEngine.Object.Destroy(this.AniWaterLayer[j * 4 + 1]);
}
if (this.AniWaterLayer[j * 4 + 2] != null)
{
UnityEngine.Object.Destroy(this.AniWaterLayer[j * 4 + 2]);
}
if (this.AniWaterLayer[j * 4 + 3] != null)
{
UnityEngine.Object.Destroy(this.AniWaterLayer[j * 4 + 3]);
}
this.AniWaterLayer[j * 4] = (UnityEngine.Object.Instantiate(this.AniWaterPrefab[j], base.transform.position, Quaternion.identity) as GameObject);
this.AniWaterLayer[j * 4 + 1] = (UnityEngine.Object.Instantiate(this.AniWaterPrefab[j], base.transform.position, Quaternion.identity) as GameObject);
this.AniWaterLayer[j * 4 + 2] = (UnityEngine.Object.Instantiate(this.AniWaterPrefab[j], base.transform.position, Quaternion.identity) as GameObject);
this.AniWaterLayer[j * 4 + 3] = (UnityEngine.Object.Instantiate(this.AniWaterPrefab[j], base.transform.position, Quaternion.identity) as GameObject);
this.AniWaterLayer[j * 4].GetComponent<Renderer>().sortingOrder = -3;
this.AniWaterLayer[j * 4 + 1].GetComponent<Renderer>().sortingOrder = -2;
this.AniWaterLayer[j * 4 + 2].GetComponent<Renderer>().sortingOrder = -1;
}
GameObject[] array = GameObject.FindGameObjectsWithTag("MapEffects");
GameObject[] array2 = array;
for (int k = 0; k < array2.Length; k++)
{
GameObject obj = array2[k];
UnityEngine.Object.Destroy(obj);
}
if (this.mapName.ToLower() == "pokemon tower 2f" || this.mapName.ToLower() == "pokemon tower 3f" || this.mapName.ToLower() == "pokemon tower 4f" || this.mapName.ToLower() == "pokemon tower 5f" || this.mapName.ToLower() == "pokemon tower 6f" || this.mapName.ToLower() == "pokemon tower 7f" || this.mapName.ToLower() == "ecruteak gym")
{
UnityEngine.Object.Instantiate(this.TowerFog, new Vector3(10f, -20f, 0f), Quaternion.identity);
this.MapWeather = "Tower Fog";
}
else if (this.MapWeather == "Tower Fog")
{
UnityEngine.Object.Instantiate(this.TowerFog, new Vector3(10f, -20f, 0f), Quaternion.identity);
}
this.SandStorm.SetActive(false);
if (this.MapWeather == "Sandstorm")
{
this.SandStorm.SetActive(true);
}
int num = 0;
int num2 = 0;
int num3 = 42;
int num4 = 64;
int num5 = 1024;
int num6 = num3 * num4;
this.TileMaker = new GameObject[num6 * 4];
for (int l = 0; l < num6; l++)
{
this.TileMaker[l] = (UnityEngine.Object.Instantiate(this.TileMakerPrefab, base.transform.position, Quaternion.identity) as GameObject);
this.TileMaker[l].name = "Chunk_Layer1_" + num.ToString() + "_" + num2.ToString();
this.TileMaker[l].transform.parent = base.transform;
num++;
if (num >= num4)
{
num = 0;
num2++;
}
}
num = 0;
num2 = 0;
for (int m = 0; m < num6; m++)
{
this.TileMaker[m + num6] = (UnityEngine.Object.Instantiate(this.TileMakerPrefab, base.transform.position, Quaternion.identity) as GameObject);
this.TileMaker[m + num6].name = "Chunk_Layer2_" + num.ToString() + "_" + num2.ToString();
this.TileMaker[m + num6].transform.parent = base.transform;
num++;
if (num >= num4)
{
num = 0;
num2++;
}
}
num = 0;
num2 = 0;
for (int n = 0; n < num6; n++)
{
this.TileMaker[n + num6 * 2] = (UnityEngine.Object.Instantiate(this.TileMakerPrefab, base.transform.position, Quaternion.identity) as GameObject);
this.TileMaker[n + num6 * 2].name = "Chunk_Layer3_" + num.ToString() + "_" + num2.ToString();
this.TileMaker[n + num6 * 2].transform.parent = base.transform;
num++;
if (num >= num4)
{
num = 0;
num2++;
}
}
num = 0;
num2 = 0;
for (int num7 = 0; num7 < num6; num7++)
{
this.TileMaker[num7 + num6 * 3] = (UnityEngine.Object.Instantiate(this.TileMakerPrefab, base.transform.position, Quaternion.identity) as GameObject);
this.TileMaker[num7 + num6 * 3].name = "Chunk_Layer4_" + num.ToString() + "_" + num2.ToString();
this.TileMaker[num7 + num6 * 3].transform.parent = base.transform;
num++;
if (num >= num4)
{
num = 0;
num2++;
}
}
this.newVertices = new List<Vector3>[num6];
this.newTriangles = new List<int>[num6];
this.newUV = new List<Vector2>[num6];
this.newVertices2 = new List<Vector3>[num6];
this.newTriangles2 = new List<int>[num6];
this.newUV2 = new List<Vector2>[num6];
this.newVertices3 = new List<Vector3>[num6];
this.newTriangles3 = new List<int>[num6];
this.newUV3 = new List<Vector2>[num6];
this.newVertices4 = new List<Vector3>[num6];
this.newTriangles4 = new List<int>[num6];
this.newUV4 = new List<Vector2>[num6];
this.newCount1 = new int[num6];
this.newCount2 = new int[num6];
this.newCount3 = new int[num6];
this.newCount4 = new int[num6];
for (int num8 = 0; num8 < num6; num8++)
{
this.newVertices[num8] = new List<Vector3>();
this.newTriangles[num8] = new List<int>();
this.newUV[num8] = new List<Vector2>();
this.newVertices2[num8] = new List<Vector3>();
this.newTriangles2[num8] = new List<int>();
this.newUV2[num8] = new List<Vector2>();
this.newVertices3[num8] = new List<Vector3>();
this.newTriangles3[num8] = new List<int>();
this.newUV3[num8] = new List<Vector2>();
this.newVertices4[num8] = new List<Vector3>();
this.newTriangles4[num8] = new List<int>();
this.newUV4[num8] = new List<Vector2>();
}
setUVs setUVs = new setUVs();
int[] array3 = new int[num3];
int[] array4 = new int[num3];
int[] array5 = new int[num3];
int[] array6 = new int[num3];
for (int num9 = 0; num9 < this.Width + 1; num9++)
{
for (int num10 = 0; num10 < this.Height + 1; num10++)
{
if (this.Links[num9, num10] > 0 && (num9 > 0 || num10 > 0))
{
UnityEngine.Object.Instantiate(this.LinkPrefab, new Vector3((float)num9, (float)(-(float)num10) + 0.5f, 0f), Quaternion.identity);
}
bool flag = false;
Vector3 vector;
if (this.Tiles[num9, num10] >= 1)
{
int num11 = this.Tiles[num9, num10];
vector.x = (float)num9;
vector.y = (float)(-(float)num10);
vector.z = 0f;
if (((float)num11 / 8f - (float)(num11 / 8)) * 8f < 0f)
{
setUVs.TileX = 8f - ((float)num11 / 8f - (float)(num11 / 8)) * 8f;
}
else
{
setUVs.TileX = ((float)num11 / 8f - (float)(num11 / 8)) * 8f;
}
setUVs.TileX += 1f;
setUVs.TileY = (float)(num11 / 8 + 1);
if (num11 == 5897)
{
this.AniWaterLayer[0].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5896)
{
this.AniWaterLayer[4].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5898)
{
this.AniWaterLayer[8].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5888)
{
this.AniWaterLayer[12].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5889)
{
this.AniWaterLayer[16].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5890)
{
this.AniWaterLayer[20].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5904)
{
this.AniWaterLayer[24].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5905)
{
this.AniWaterLayer[28].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5906)
{
this.AniWaterLayer[32].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5891)
{
this.AniWaterLayer[36].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5892)
{
this.AniWaterLayer[40].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5899)
{
this.AniWaterLayer[44].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5900)
{
this.AniWaterLayer[48].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5900)
{
this.AniWaterLayer[48].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5912)
{
this.AniWaterLayer[76].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5913)
{
this.AniWaterLayer[80].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5914)
{
this.AniWaterLayer[84].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5920)
{
this.AniWaterLayer[88].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5921)
{
this.AniWaterLayer[92].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5922)
{
this.AniWaterLayer[96].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5928)
{
this.AniWaterLayer[100].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5929)
{
this.AniWaterLayer[104].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5930)
{
this.AniWaterLayer[108].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5915)
{
this.AniWaterLayer[112].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5916)
{
this.AniWaterLayer[116].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5923)
{
this.AniWaterLayer[120].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5924)
{
this.AniWaterLayer[124].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6002)
{
this.AniWaterLayer[208].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5968)
{
this.AniWaterLayer[216].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5969)
{
this.AniWaterLayer[220].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5970)
{
this.AniWaterLayer[224].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5976)
{
this.AniWaterLayer[228].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5977)
{
this.AniWaterLayer[232].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5978)
{
this.AniWaterLayer[236].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5984)
{
this.AniWaterLayer[240].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5985)
{
this.AniWaterLayer[244].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5986)
{
this.AniWaterLayer[248].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5971)
{
this.AniWaterLayer[252].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5972)
{
this.AniWaterLayer[256].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5979)
{
this.AniWaterLayer[260].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5980)
{
this.AniWaterLayer[264].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17645)
{
this.AniWaterLayer[304].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17646)
{
this.AniWaterLayer[308].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17647)
{
this.AniWaterLayer[312].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17653)
{
this.AniWaterLayer[316].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17654)
{
this.AniWaterLayer[320].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17655)
{
this.AniWaterLayer[324].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17661)
{
this.AniWaterLayer[328].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17662)
{
this.AniWaterLayer[332].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17663)
{
this.AniWaterLayer[336].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17629)
{
this.AniWaterLayer[340].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17630)
{
this.AniWaterLayer[344].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17637)
{
this.AniWaterLayer[348].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17638)
{
this.AniWaterLayer[352].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28306)
{
this.AniWaterLayer[268].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28314)
{
this.AniWaterLayer[272].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28304)
{
this.AniWaterLayer[276].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28312)
{
this.AniWaterLayer[280].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 31321)
{
this.AniWaterLayer[284].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
flag = true;
}
if (num11 == 31312 || num11 == 31313 || num11 == 31314 || num11 == 31315 || num11 == 31316 || num11 == 31320 || num11 == 31322 || num11 == 31323 || num11 == 31324 || num11 == 31328 || num11 == 31329 || num11 == 31330)
{
this.AniWaterLayer[284].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
}
if (num11 == 5902)
{
this.AniWaterLayer[284].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
flag = true;
}
if (num11 == 5893 || num11 == 5894 || num11 == 5895 || num11 == 5901 || num11 == 5903 || num11 == 5909 || num11 == 5910 || num11 == 5911 || num11 == 5918 || num11 == 5919 || num11 == 5926 || num11 == 5927)
{
this.AniWaterLayer[284].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
}
if (num11 == 22227)
{
this.AniWaterLayer[288].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6004)
{
this.AniWaterLayer[292].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5942)
{
this.AniWaterLayer[300].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17008)
{
this.AniWaterLayer[456].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17009)
{
this.AniWaterLayer[460].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17010)
{
this.AniWaterLayer[464].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17016)
{
this.AniWaterLayer[468].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17017)
{
this.AniWaterLayer[472].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17018)
{
this.AniWaterLayer[476].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17024)
{
this.AniWaterLayer[480].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17025)
{
this.AniWaterLayer[484].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17026)
{
this.AniWaterLayer[488].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17032)
{
this.AniWaterLayer[492].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17033)
{
this.AniWaterLayer[496].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17034)
{
this.AniWaterLayer[500].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17040)
{
this.AniWaterLayer[504].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17041)
{
this.AniWaterLayer[508].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17042)
{
this.AniWaterLayer[512].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17048)
{
this.AniWaterLayer[516].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17049)
{
this.AniWaterLayer[520].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17050)
{
this.AniWaterLayer[524].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17056)
{
this.AniWaterLayer[528].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17057)
{
this.AniWaterLayer[532].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17058)
{
this.AniWaterLayer[536].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17064)
{
this.AniWaterLayer[540].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17065)
{
this.AniWaterLayer[544].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17066)
{
this.AniWaterLayer[548].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17072)
{
this.AniWaterLayer[552].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17073)
{
this.AniWaterLayer[556].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17074)
{
this.AniWaterLayer[560].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (!flag)
{
for (int num12 = 0; num12 < num3; num12++)
{
if (setUVs.TileY > (float)(num12 * 128) && setUVs.TileY <= (float)((num12 + 1) * 128))
{
int num13 = 0;
int num14 = array3[num12];
for (int num15 = 0; num15 < num4; num15++)
{
if (array3[num12] <= num5 || (array3[num12] > num15 * num5 && array3[num12] <= (num15 + 1) * num5))
{
num13 = num12 * num4 + num15;
if (array3[num12] > num5)
{
num14 -= num5 * num15 + 1;
}
break;
}
}
this.newVertices[num13].Add(new Vector3(vector.x - this.OverLap, vector.y + this.OverLap, vector.z));
this.newVertices[num13].Add(new Vector3(vector.x + 1f + this.OverLap, vector.y + this.OverLap, vector.z));
this.newVertices[num13].Add(new Vector3(vector.x - this.OverLap, vector.y - 1f - this.OverLap, vector.z));
this.newVertices[num13].Add(new Vector3(vector.x + 1f + this.OverLap, vector.y - 1f - this.OverLap, vector.z));
this.newTriangles[num13].Add(2 + num14 * 4);
this.newTriangles[num13].Add(0 + num14 * 4);
this.newTriangles[num13].Add(3 + num14 * 4);
this.newTriangles[num13].Add(3 + num14 * 4);
this.newTriangles[num13].Add(0 + num14 * 4);
this.newTriangles[num13].Add(1 + num14 * 4);
this.newCount1[num13] = num14;
array3[num12]++;
setUVs.TileY += (float)(-(float)(128 * num12));
if (setUVs.TileY > 32f && setUVs.TileY <= 64f)
{
setUVs.TileY += -32f;
setUVs.TileX += 8f;
}
if (setUVs.TileY > 64f && setUVs.TileY <= 96f)
{
setUVs.TileY += -64f;
setUVs.TileX += 16f;
}
if (setUVs.TileY > 96f && setUVs.TileY <= 128f)
{
setUVs.TileY += -96f;
setUVs.TileX += 24f;
}
setUVs.Fix();
this.newUV[num13].Add(setUVs.uvSwap[2]);
this.newUV[num13].Add(setUVs.uvSwap[0]);
this.newUV[num13].Add(setUVs.uvSwap[1]);
this.newUV[num13].Add(setUVs.uvSwap[3]);
break;
}
}
}
}
flag = false;
if (this.Tiles2[num9, num10] >= 1)
{
int num11 = this.Tiles2[num9, num10];
vector.x = (float)num9;
vector.y = (float)(-(float)num10);
vector.z = 0f;
if (num11 == 10492)
{
UnityEngine.Object.Instantiate(this.EffectLight, vector + new Vector3(0f, 0f, -0f), Quaternion.identity);
}
else if (num11 == 10493)
{
UnityEngine.Object.Instantiate(this.EffectLight, vector + new Vector3(0f, 0.2f, -0f), Quaternion.identity);
}
else if (num11 == 15059)
{
UnityEngine.Object.Instantiate(this.GameLight, vector + new Vector3(0.5f, 0.62f, -0.02f), Quaternion.identity);
}
else if (num11 == 5948)
{
UnityEngine.Object.Instantiate(this.PokeFloor, vector + new Vector3(1f, -1f, -0f), Quaternion.identity);
}
else if (num11 == 28328)
{
UnityEngine.Object.Instantiate(this.Lab2, vector + new Vector3(0.5f, 0f, 0f), Quaternion.identity);
flag = true;
}
else if (num11 == 31379)
{
UnityEngine.Object.Instantiate(this.AniDoorPrefab, vector + new Vector3(0.3675f, 0f, 0f), Quaternion.identity);
}
else if (num11 == 8790)
{
UnityEngine.Object.Instantiate(this.StoreDoor, vector + new Vector3(0.25f, -0.07f, 0f), Quaternion.identity);
}
else if (num11 == 8491)
{
UnityEngine.Object.Instantiate(this.GymDoor, vector + new Vector3(0f, 0f, 0f), Quaternion.identity);
}
else if (num11 == 31418)
{
UnityEngine.Object.Instantiate(this.AniDoubleDoorPrefab, vector + new Vector3(0.3675f, -0.5f, 0f), Quaternion.identity);
}
else if (num11 == 28329)
{
flag = true;
}
else if (num11 == 2850)
{
}
if (num11 == 5948 || num11 == 5949 || num11 == 5950 || num11 == 5956 || num11 == 5957 || num11 == 5958 || num11 == 5964 || num11 == 5965 || num11 == 5966)
{
flag = true;
}
if (((float)num11 / 8f - (float)(num11 / 8)) * 8f < 0f)
{
setUVs.TileX = 8f - ((float)num11 / 8f - (float)(num11 / 8)) * 8f;
}
else
{
setUVs.TileX = ((float)num11 / 8f - (float)(num11 / 8)) * 8f;
}
setUVs.TileX += 1f;
setUVs.TileY = (float)(num11 / 8 + 1);
if (num11 == 5897)
{
this.AniWaterLayer[1].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5896)
{
this.AniWaterLayer[5].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5898)
{
this.AniWaterLayer[9].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5888)
{
this.AniWaterLayer[13].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5889)
{
this.AniWaterLayer[17].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5890)
{
this.AniWaterLayer[21].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5904)
{
this.AniWaterLayer[25].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5905)
{
this.AniWaterLayer[29].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5906)
{
this.AniWaterLayer[33].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5891)
{
this.AniWaterLayer[37].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5892)
{
this.AniWaterLayer[41].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5899)
{
this.AniWaterLayer[45].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5900)
{
this.AniWaterLayer[49].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 62)
{
this.AniWaterLayer[53].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5941)
{
this.AniWaterLayer[57].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5932)
{
this.AniWaterLayer[53].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5933)
{
this.AniWaterLayer[61].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5940)
{
this.AniWaterLayer[65].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5934)
{
this.AniWaterLayer[69].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5935)
{
this.AniWaterLayer[73].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 7382)
{
UnityEngine.Object.Instantiate(this.StairPrefab[0], vector + new Vector3(0f, 0.5f, -5f), Quaternion.identity);
}
if (num11 == 7414)
{
UnityEngine.Object.Instantiate(this.StairPrefab[1], vector + new Vector3(0f, 0f, -5f), Quaternion.identity);
}
if (num11 == 7378)
{
UnityEngine.Object.Instantiate(this.StairPrefab[2], vector + new Vector3(0f, 0f, -5f), Quaternion.identity);
}
if (num11 == 7410)
{
UnityEngine.Object.Instantiate(this.StairPrefab[3], vector + new Vector3(0f, 0.5f, -5f), Quaternion.identity);
}
if (num11 == 86)
{
UnityEngine.Object.Instantiate(this.TreePrefab, vector, Quaternion.identity);
flag = true;
}
if (num11 == 87)
{
UnityEngine.Object.Instantiate(this.TreePrefab, vector, Quaternion.identity);
flag = true;
}
if (this.Colliders[num9, num10] == 13)
{
UnityEngine.Object.Instantiate(this.RockPrefab, vector, Quaternion.identity);
flag = true;
}
if (num11 == 78)
{
flag = true;
}
if (num11 == 79)
{
flag = true;
}
if (num11 == 5912)
{
this.AniWaterLayer[77].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5913)
{
this.AniWaterLayer[81].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5914)
{
this.AniWaterLayer[85].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5920)
{
this.AniWaterLayer[89].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5921)
{
this.AniWaterLayer[93].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5922)
{
this.AniWaterLayer[97].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5928)
{
this.AniWaterLayer[101].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5929)
{
this.AniWaterLayer[105].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5930)
{
this.AniWaterLayer[109].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5915)
{
this.AniWaterLayer[113].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5916)
{
this.AniWaterLayer[117].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5923)
{
this.AniWaterLayer[121].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5924)
{
this.AniWaterLayer[125].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5936)
{
this.AniWaterLayer[129].GetComponent<AniTiles>().addTile(vector, 4, 1, 1);
flag = true;
}
if (num11 == 5937 || num11 == 5938 || num11 == 5939 || num11 == 5944 || num11 == 5945 || num11 == 5946 || num11 == 5947 || num11 == 5952 || num11 == 5953 || num11 == 5954 || num11 == 5955 || num11 == 5960 || num11 == 5961 || num11 == 5962 || num11 == 5963)
{
flag = true;
}
if (num11 == 5902)
{
this.AniWaterLayer[285].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
flag = true;
}
if (num11 == 5893 || num11 == 5894 || num11 == 5895 || num11 == 5901 || num11 == 5903 || num11 == 5909 || num11 == 5910 || num11 == 5911 || num11 == 5918 || num11 == 5919 || num11 == 5926 || num11 == 5927)
{
this.AniWaterLayer[285].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
}
if (num11 == 5989)
{
this.AniWaterLayer[133].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5990)
{
this.AniWaterLayer[137].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5991)
{
this.AniWaterLayer[141].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5997)
{
this.AniWaterLayer[145].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5998)
{
this.AniWaterLayer[149].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5999)
{
this.AniWaterLayer[153].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6005)
{
this.AniWaterLayer[157].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6006)
{
this.AniWaterLayer[161].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6007)
{
this.AniWaterLayer[165].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5987)
{
this.AniWaterLayer[169].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5988)
{
this.AniWaterLayer[173].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5995)
{
this.AniWaterLayer[177].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5996)
{
this.AniWaterLayer[181].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6488)
{
this.AniWaterLayer[185].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6489)
{
this.AniWaterLayer[189].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6490)
{
this.AniWaterLayer[193].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6496)
{
this.AniWaterLayer[197].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6497)
{
this.AniWaterLayer[201].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6498)
{
this.AniWaterLayer[205].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6002)
{
this.AniWaterLayer[209].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6118)
{
this.AniWaterLayer[213].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
UnityEngine.Object.Instantiate(this.FireLight, vector + new Vector3(0f, 0f, -1f), Quaternion.identity);
}
if (num11 == 6115)
{
this.AniWaterLayer[565].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
UnityEngine.Object.Instantiate(this.FireLight, vector + new Vector3(0f, 0f, -1f), Quaternion.identity);
}
if (num11 == 5968)
{
this.AniWaterLayer[217].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5969)
{
this.AniWaterLayer[221].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5970)
{
this.AniWaterLayer[225].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5976)
{
this.AniWaterLayer[229].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5977)
{
this.AniWaterLayer[233].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5978)
{
this.AniWaterLayer[237].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5984)
{
this.AniWaterLayer[241].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5985)
{
this.AniWaterLayer[245].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5986)
{
this.AniWaterLayer[249].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5971)
{
this.AniWaterLayer[253].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5972)
{
this.AniWaterLayer[257].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5979)
{
this.AniWaterLayer[261].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5980)
{
this.AniWaterLayer[265].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17645)
{
this.AniWaterLayer[305].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17646)
{
this.AniWaterLayer[309].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17647)
{
this.AniWaterLayer[313].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17653)
{
this.AniWaterLayer[317].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17654)
{
this.AniWaterLayer[321].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17655)
{
this.AniWaterLayer[325].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17661)
{
this.AniWaterLayer[329].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17662)
{
this.AniWaterLayer[333].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17663)
{
this.AniWaterLayer[337].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17629)
{
this.AniWaterLayer[341].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17630)
{
this.AniWaterLayer[345].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17637)
{
this.AniWaterLayer[349].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17638)
{
this.AniWaterLayer[353].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28306)
{
this.AniWaterLayer[269].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28314)
{
this.AniWaterLayer[273].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28304)
{
this.AniWaterLayer[277].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28312)
{
this.AniWaterLayer[281].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27760)
{
this.AniWaterLayer[357].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
UnityEngine.Object.Instantiate(this.EnviromentalSounds[0], vector + new Vector3(2f, 0f, -5f), Quaternion.identity);
}
if (num11 == 27761)
{
this.AniWaterLayer[361].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27762)
{
this.AniWaterLayer[365].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27763)
{
this.AniWaterLayer[369].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27768)
{
this.AniWaterLayer[373].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27769)
{
this.AniWaterLayer[377].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27770)
{
this.AniWaterLayer[381].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27771)
{
this.AniWaterLayer[385].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27776)
{
this.AniWaterLayer[389].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27777)
{
this.AniWaterLayer[393].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27778)
{
this.AniWaterLayer[397].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27779)
{
this.AniWaterLayer[401].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27784)
{
this.AniWaterLayer[405].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27785)
{
this.AniWaterLayer[409].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27786)
{
this.AniWaterLayer[413].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27787)
{
this.AniWaterLayer[417].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27764)
{
this.AniWaterLayer[421].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
UnityEngine.Object.Instantiate(this.EnviromentalSounds[0], vector + new Vector3(1f, 0f, -5f), Quaternion.identity);
}
if (num11 == 27765)
{
this.AniWaterLayer[425].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27766)
{
this.AniWaterLayer[429].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27772)
{
this.AniWaterLayer[433].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27773)
{
this.AniWaterLayer[437].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27774)
{
this.AniWaterLayer[441].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27780)
{
this.AniWaterLayer[445].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27781)
{
this.AniWaterLayer[449].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27782)
{
this.AniWaterLayer[453].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17651)
{
this.AniWaterLayer[585].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 31321)
{
this.AniWaterLayer[285].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
flag = true;
}
if (num11 == 31312 || num11 == 31313 || num11 == 31314 || num11 == 31315 || num11 == 31316 || num11 == 31320 || num11 == 31322 || num11 == 31323 || num11 == 31324 || num11 == 31328 || num11 == 31329 || num11 == 31330)
{
this.AniWaterLayer[285].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
}
if (num11 == 22227)
{
this.AniWaterLayer[289].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6004)
{
this.AniWaterLayer[293].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 1891)
{
this.AniWaterLayer[297].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5942)
{
this.AniWaterLayer[301].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17008)
{
this.AniWaterLayer[457].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17009)
{
this.AniWaterLayer[461].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17010)
{
this.AniWaterLayer[465].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17016)
{
this.AniWaterLayer[469].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17017)
{
this.AniWaterLayer[473].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17018)
{
this.AniWaterLayer[477].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17024)
{
this.AniWaterLayer[481].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17025)
{
this.AniWaterLayer[485].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17026)
{
this.AniWaterLayer[489].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17032)
{
this.AniWaterLayer[493].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17033)
{
this.AniWaterLayer[497].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17034)
{
this.AniWaterLayer[501].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17040)
{
this.AniWaterLayer[505].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17041)
{
this.AniWaterLayer[509].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17042)
{
this.AniWaterLayer[513].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17048)
{
this.AniWaterLayer[517].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17049)
{
this.AniWaterLayer[521].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17050)
{
this.AniWaterLayer[525].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17056)
{
this.AniWaterLayer[529].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17057)
{
this.AniWaterLayer[533].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17058)
{
this.AniWaterLayer[537].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17064)
{
this.AniWaterLayer[541].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17065)
{
this.AniWaterLayer[545].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17066)
{
this.AniWaterLayer[549].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17072)
{
this.AniWaterLayer[553].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17073)
{
this.AniWaterLayer[557].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17074)
{
this.AniWaterLayer[561].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (!flag)
{
for (int num16 = 0; num16 < num3; num16++)
{
if (setUVs.TileY > (float)(num16 * 128) && setUVs.TileY <= (float)((num16 + 1) * 128))
{
int num13 = 0;
int num14 = array4[num16];
for (int num17 = 0; num17 < num4; num17++)
{
if (array4[num16] <= num5 || (array4[num16] > num17 * num5 && array4[num16] <= (num17 + 1) * num5))
{
num13 = num16 * num4 + num17;
if (array4[num16] > num5)
{
num14 -= num5 * num17 + 1;
}
break;
}
}
this.newVertices2[num13].Add(new Vector3(vector.x, vector.y, vector.z));
this.newVertices2[num13].Add(new Vector3(vector.x + 1f, vector.y, vector.z));
this.newVertices2[num13].Add(new Vector3(vector.x, vector.y - 1f, vector.z));
this.newVertices2[num13].Add(new Vector3(vector.x + 1f, vector.y - 1f, vector.z));
this.newTriangles2[num13].Add(2 + num14 * 4);
this.newTriangles2[num13].Add(0 + num14 * 4);
this.newTriangles2[num13].Add(3 + num14 * 4);
this.newTriangles2[num13].Add(3 + num14 * 4);
this.newTriangles2[num13].Add(0 + num14 * 4);
this.newTriangles2[num13].Add(1 + num14 * 4);
this.newCount2[num13] = num14;
array4[num16]++;
setUVs.TileY += (float)(-(float)(128 * num16));
if (setUVs.TileY > 32f && setUVs.TileY <= 64f)
{
setUVs.TileY += -32f;
setUVs.TileX += 8f;
}
if (setUVs.TileY > 64f && setUVs.TileY <= 96f)
{
setUVs.TileY += -64f;
setUVs.TileX += 16f;
}
if (setUVs.TileY > 96f && setUVs.TileY <= 128f)
{
setUVs.TileY += -96f;
setUVs.TileX += 24f;
}
setUVs.Fix();
this.newUV2[num13].Add(setUVs.uvSwap[2]);
this.newUV2[num13].Add(setUVs.uvSwap[0]);
this.newUV2[num13].Add(setUVs.uvSwap[1]);
this.newUV2[num13].Add(setUVs.uvSwap[3]);
break;
}
}
}
}
flag = false;
if (this.Tiles3[num9, num10] >= 1)
{
int num11 = this.Tiles3[num9, num10];
vector.x = (float)num9;
vector.y = (float)(-(float)num10);
vector.z = 0f;
if (num11 == 10492)
{
UnityEngine.Object.Instantiate(this.EffectLight, vector + new Vector3(0f, 0.4f, -0f), Quaternion.identity);
}
else if (num11 == 10493)
{
UnityEngine.Object.Instantiate(this.EffectLight, vector + new Vector3(0f, 0.2f, -0f), Quaternion.identity);
}
else if (num11 == 22150)
{
UnityEngine.Object.Instantiate(this.Lights[6], vector + new Vector3(0f, -0.1f, -0f), Quaternion.identity);
}
else if (num11 == 15059)
{
UnityEngine.Object.Instantiate(this.GameLight, vector + new Vector3(0.5f, 0.62f, -0.02f), Quaternion.identity);
}
else if (num11 == 5948)
{
UnityEngine.Object.Instantiate(this.PokeFloor, vector + new Vector3(1f, -1f, -0f), Quaternion.identity);
}
else if (num11 == 28328)
{
UnityEngine.Object.Instantiate(this.Lab2, vector + new Vector3(0.5f, 0f, 0f), Quaternion.identity);
flag = true;
}
else if (num11 == 31379)
{
UnityEngine.Object.Instantiate(this.AniDoorPrefab, vector + new Vector3(0.3675f, 0f, 0f), Quaternion.identity);
}
else if (num11 == 8790)
{
UnityEngine.Object.Instantiate(this.StoreDoor, vector + new Vector3(0.25f, -0.07f, 0f), Quaternion.identity);
}
else if (num11 == 8491)
{
UnityEngine.Object.Instantiate(this.GymDoor, vector + new Vector3(0f, 0f, 0f), Quaternion.identity);
}
else if (num11 == 31418)
{
UnityEngine.Object.Instantiate(this.AniDoubleDoorPrefab, vector + new Vector3(0.3675f, -0.5f, 0f), Quaternion.identity);
}
else if (num11 == 28329)
{
flag = true;
}
if (num11 == 5948 || num11 == 5949 || num11 == 5950 || num11 == 5956 || num11 == 5957 || num11 == 5958 || num11 == 5964 || num11 == 5965 || num11 == 5966)
{
flag = true;
}
if (((float)num11 / 8f - (float)(num11 / 8)) * 8f < 0f)
{
setUVs.TileX = 8f - ((float)num11 / 8f - (float)(num11 / 8)) * 8f;
}
else
{
setUVs.TileX = ((float)num11 / 8f - (float)(num11 / 8)) * 8f;
}
setUVs.TileX += 1f;
setUVs.TileY = (float)(num11 / 8 + 1);
if (num11 == 5897)
{
this.AniWaterLayer[2].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5896)
{
this.AniWaterLayer[6].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5898)
{
this.AniWaterLayer[10].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5888)
{
this.AniWaterLayer[14].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5889)
{
this.AniWaterLayer[18].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5890)
{
this.AniWaterLayer[22].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5904)
{
this.AniWaterLayer[26].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5905)
{
this.AniWaterLayer[30].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5906)
{
this.AniWaterLayer[34].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5891)
{
this.AniWaterLayer[38].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5892)
{
this.AniWaterLayer[42].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5899)
{
this.AniWaterLayer[46].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5900)
{
this.AniWaterLayer[50].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 62)
{
this.AniWaterLayer[54].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 86)
{
UnityEngine.Object.Instantiate(this.TreePrefab, vector, Quaternion.identity);
flag = true;
}
if (num11 == 87)
{
UnityEngine.Object.Instantiate(this.TreePrefab, vector, Quaternion.identity);
flag = true;
}
if (num11 == 78)
{
flag = true;
}
if (num11 == 79)
{
flag = true;
}
if (num11 == 5912)
{
this.AniWaterLayer[78].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5913)
{
this.AniWaterLayer[82].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5914)
{
this.AniWaterLayer[86].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5920)
{
this.AniWaterLayer[90].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5921)
{
this.AniWaterLayer[94].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5922)
{
this.AniWaterLayer[98].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5928)
{
this.AniWaterLayer[102].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5929)
{
this.AniWaterLayer[106].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5930)
{
this.AniWaterLayer[110].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5915)
{
this.AniWaterLayer[114].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5916)
{
this.AniWaterLayer[118].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5923)
{
this.AniWaterLayer[122].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5924)
{
this.AniWaterLayer[126].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5936)
{
this.AniWaterLayer[130].GetComponent<AniTiles>().addTile(vector, 4, 1, 1);
flag = true;
}
if (num11 == 7382)
{
UnityEngine.Object.Instantiate(this.StairPrefab[0], vector + new Vector3(0f, 0.5f, -5f), Quaternion.identity);
}
if (num11 == 7414)
{
UnityEngine.Object.Instantiate(this.StairPrefab[1], vector + new Vector3(0f, 0f, -5f), Quaternion.identity);
}
if (num11 == 7378)
{
UnityEngine.Object.Instantiate(this.StairPrefab[2], vector + new Vector3(0f, 0f, -5f), Quaternion.identity);
}
if (num11 == 7410)
{
UnityEngine.Object.Instantiate(this.StairPrefab[3], vector + new Vector3(0f, 0.5f, -5f), Quaternion.identity);
}
if (num11 == 5937 || num11 == 5938 || num11 == 5939 || num11 == 5944 || num11 == 5945 || num11 == 5946 || num11 == 5947 || num11 == 5952 || num11 == 5953 || num11 == 5954 || num11 == 5955 || num11 == 5960 || num11 == 5961 || num11 == 5962 || num11 == 5963)
{
flag = true;
}
if (num11 == 5989)
{
this.AniWaterLayer[134].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5990)
{
this.AniWaterLayer[138].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5991)
{
this.AniWaterLayer[142].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5997)
{
this.AniWaterLayer[146].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5998)
{
this.AniWaterLayer[150].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5999)
{
this.AniWaterLayer[154].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6005)
{
this.AniWaterLayer[158].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6006)
{
this.AniWaterLayer[162].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6007)
{
this.AniWaterLayer[166].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5987)
{
this.AniWaterLayer[170].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5988)
{
this.AniWaterLayer[174].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5995)
{
this.AniWaterLayer[178].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5996)
{
this.AniWaterLayer[182].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6488)
{
this.AniWaterLayer[186].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6489)
{
this.AniWaterLayer[190].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6490)
{
this.AniWaterLayer[194].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6496)
{
this.AniWaterLayer[198].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6497)
{
this.AniWaterLayer[202].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6498)
{
this.AniWaterLayer[206].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6002)
{
this.AniWaterLayer[210].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6118)
{
this.AniWaterLayer[214].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
UnityEngine.Object.Instantiate(this.FireLight, vector + new Vector3(0f, 0f, -1f), Quaternion.identity);
}
if (num11 == 6115)
{
this.AniWaterLayer[566].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
UnityEngine.Object.Instantiate(this.FireLight, vector + new Vector3(0f, 0f, -1f), Quaternion.identity);
}
if (num11 == 5968)
{
this.AniWaterLayer[218].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5969)
{
this.AniWaterLayer[222].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5970)
{
this.AniWaterLayer[226].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5976)
{
this.AniWaterLayer[230].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5977)
{
this.AniWaterLayer[234].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5978)
{
this.AniWaterLayer[238].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5984)
{
this.AniWaterLayer[242].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5985)
{
this.AniWaterLayer[246].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5986)
{
this.AniWaterLayer[250].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5971)
{
this.AniWaterLayer[254].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5972)
{
this.AniWaterLayer[258].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5979)
{
this.AniWaterLayer[262].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5980)
{
this.AniWaterLayer[266].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17645)
{
this.AniWaterLayer[306].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17646)
{
this.AniWaterLayer[310].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17647)
{
this.AniWaterLayer[314].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17653)
{
this.AniWaterLayer[318].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17654)
{
this.AniWaterLayer[322].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17655)
{
this.AniWaterLayer[326].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17661)
{
this.AniWaterLayer[330].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17662)
{
this.AniWaterLayer[334].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17663)
{
this.AniWaterLayer[338].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17629)
{
this.AniWaterLayer[342].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17630)
{
this.AniWaterLayer[346].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17637)
{
this.AniWaterLayer[350].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17638)
{
this.AniWaterLayer[354].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28306)
{
this.AniWaterLayer[270].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28314)
{
this.AniWaterLayer[274].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28304)
{
this.AniWaterLayer[278].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 28312)
{
this.AniWaterLayer[282].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 31321)
{
this.AniWaterLayer[286].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
flag = true;
}
if (num11 == 31312 || num11 == 31313 || num11 == 31314 || num11 == 31315 || num11 == 31316 || num11 == 31320 || num11 == 31322 || num11 == 31323 || num11 == 31324 || num11 == 31328 || num11 == 31329 || num11 == 31330)
{
this.AniWaterLayer[286].GetComponent<AniTiles>().addTile(vector, 1, this.Width, this.Height);
}
if (num11 == 22227)
{
this.AniWaterLayer[290].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 6004)
{
this.AniWaterLayer[294].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 1891)
{
this.AniWaterLayer[298].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 5942)
{
this.AniWaterLayer[302].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27760)
{
this.AniWaterLayer[358].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
UnityEngine.Object.Instantiate(this.EnviromentalSounds[0], vector + new Vector3(2f, 0f, -5f), Quaternion.identity);
}
if (num11 == 27761)
{
this.AniWaterLayer[362].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27762)
{
this.AniWaterLayer[366].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27763)
{
this.AniWaterLayer[370].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27768)
{
this.AniWaterLayer[374].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27769)
{
this.AniWaterLayer[378].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27770)
{
this.AniWaterLayer[382].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27771)
{
this.AniWaterLayer[386].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27776)
{
this.AniWaterLayer[390].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27777)
{
this.AniWaterLayer[394].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27778)
{
this.AniWaterLayer[398].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27779)
{
this.AniWaterLayer[402].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27784)
{
this.AniWaterLayer[406].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27785)
{
this.AniWaterLayer[410].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27786)
{
this.AniWaterLayer[414].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27787)
{
this.AniWaterLayer[418].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27764)
{
this.AniWaterLayer[422].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
UnityEngine.Object.Instantiate(this.EnviromentalSounds[0], vector + new Vector3(1f, 0f, -5f), Quaternion.identity);
}
if (num11 == 27765)
{
this.AniWaterLayer[426].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27766)
{
this.AniWaterLayer[430].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27772)
{
this.AniWaterLayer[434].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27773)
{
this.AniWaterLayer[438].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27774)
{
this.AniWaterLayer[442].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27780)
{
this.AniWaterLayer[446].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27781)
{
this.AniWaterLayer[450].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 27782)
{
this.AniWaterLayer[454].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17008)
{
this.AniWaterLayer[458].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17009)
{
this.AniWaterLayer[462].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17010)
{
this.AniWaterLayer[466].GetComponent<AniTiles>().addTile(vector, 1, 1, 1);
flag = true;
}
if (num11 == 17016)