//----------------------------------------------------- public Ev2_Polygon(Ev2_Polygon model) { m_lines = new List<Line>(); Line[] lines = model.GetLines(); for(int i=0; i<lines.Length; i++) m_lines.Add(lines[i]); m_tmpLine = null; m_lineStarted = true; m_closed = true; m_mainColor = model.GetMainColor(); }
//----------------------------------------------------- public void Load(float[] data, int[] texIds, List<byte[]> texsGen) { // Debug.Log(DEBUGTAG+"loading !"); List<IEv2_Zone> loadedZones = new List<IEv2_Zone>(); IEv2_Zone newZone = null; int i=0; while(i<data.Length) { float[] zoneData = new float[(int)data[i]]; for(int j=0; j<zoneData.Length; j++) zoneData[j] = data[i++]; // Debug.Log("grassV2 Load : num "+i+" = "+data[i-1]); if(data[i-1] == 0f) newZone = new Ev2_Polygon(); else Debug.LogError(DEBUGTAG+"load : unrecognized IEv2_Zone type ("+data[i-1]+")"); newZone.LoadFromData(zoneData); loadedZones.Add(newZone); } m_mainScene.GetComponent<PleaseWaitUI>().SetDisplayIcon(true); m_mustAddZones = true; m_zonesToAdd = loadedZones; m_zonesTexIDtoAdd = texIds; m_zonesTexGenToAdd = texsGen; }
//----------------------------------------------------- public void Load(float[] data) { // Debug.Log(DEBUGTAG+"loading !"); List<IEv2_Zone> newZones = new List<IEv2_Zone>(); IEv2_Zone newZone = null; int i=0; while(i<data.Length) { float[] zoneData = new float[(int)data[i]]; for(int j=0; j<zoneData.Length; j++) zoneData[j] = data[i++]; // Debug.Log("num "+i+" = "+data[i-1]); if(data[i-1] == 0f) newZone = new Ev2_Polygon(); else Debug.LogError(DEBUGTAG+"load : unrecognized IEv2_Zone type ("+data[i-1]+")"); newZone.LoadFromData(zoneData); newZones.Add(newZone); } AddZones(newZones); }
//----------------------------------------------------- void Awake() { m_polygon = new Ev2_Polygon(); m_invert = false; UsefullEvents.OnResizingWindow += SetGUIrects; UsefullEvents.OnResizeWindowEnd += SetGUIrects; }