public void CheckDataComponent() { var Data = GetComponent <DataHexNav>(); if (Data == null) { gameObject.AddComponent <DataHexNav>(); this.Data = GetComponent <DataHexNav>(); } else { this.Data = Data; } }
private void DataRecords() { var Data = GetComponent <DataHexNav>(); if (Data == null) { Debug.LogError("Dissing data file"); } else { int j = 0; this.Data = Data; List <HexagonControl> ListWay = new List <HexagonControl>(); for (int i = 0; i < this.Data.Way.Count; i++) { if (this.Data.Way[i] != null) { ListWay.Add(this.Data.Way[i]); } else { ShortWay[this.Data.EndWay[j]] = new List <HexagonControl>(); ShortWay[this.Data.EndWay[j]].AddRange(ListWay); ListWay.Clear(); j++; } } } //Debug.Log(ShortWay.Count); //if (Row==0&&Column==0) //{ // for (int i = 0; i < ShortWay[data._endWay[74]].Count; i++) // { // ShortWay[data._endWay[74]][i].Flag(); // } //} }