public void CreateJing() { if (JingParent.transform.childCount == 0) { return; } List <string> JingNamesList = GlobalTools.GetChildsNamesList(JingParent); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)]); //if (GlobalTools.GetRandomNum() >= 60) //{ // GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)]); //} //前景 GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "qian"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "qian"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "qian"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "qian"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "qian"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "qian"); //背景 GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "bei"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "bei"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "bei"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "bei"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "bei"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "bei"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "bei"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "bei"); GetJingAndPosByJingName(JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)], "bei"); }
void Duan(int nums, GameObject parentObj, float duanX = 0) { JingNamesList = GlobalTools.GetChildsNamesList(parentObj); for (int i = 0; i < nums; i++) { string JingName = JingNamesList[GlobalTools.GetRandomNum(JingNamesList.Count)]; GameObject jing = GlobalTools.GetGameObjectInObjPoolByName(JingName); jing.name = JingName; float __x = 0; float __y = 0; if (i == 0) { __x = Air_DB_List[Air_DB_List.Count - 1].GetComponent <DB_AirBase>().TRPos.position.x; __y = Air_DB_List[Air_DB_List.Count - 1].GetComponent <DB_AirBase>().TRPos.position.y; } else { __x = Air_DB_List2[Air_DB_List2.Count - 1].GetComponent <DB_AirBase>().TRPos.position.x; __y = Air_DB_List2[Air_DB_List2.Count - 1].GetComponent <DB_AirBase>().TRPos.position.y; } jing.transform.position = new Vector3(__x, __y, -__z); Air_DB_List2.Add(jing); } //duanX = Air_DB_List2[Air_DB_List.Count - 1].transform.position.x; }
void Qishi(GameObject parentObj) { JingNamesList = GlobalTools.GetChildsNamesList(parentObj); string JingName = JingNamesList[0]; GameObject jing = GlobalTools.GetGameObjectInObjPoolByName(JingName); jing.name = JingName; float __x = Air_DB_List2[Air_DB_List2.Count - 1].GetComponent <DB_AirBase>().TRPos.position.x; float __y = Air_DB_List2[Air_DB_List2.Count - 1].GetComponent <DB_AirBase>().TRPos.position.y; jing.transform.position = new Vector3(__x, __y, -__z); Air_DB_List2.Add(jing); }
// Start is called before the first frame update void Start() { GlobalSetDate.instance.screenName = GlobalTools.GetCScreenName(); print(" ??GlobalSetDate.instance.screenName " + GlobalSetDate.instance.screenName); //Air_DB_List.Clear(); JingNamesList2 = GlobalTools.GetChildsNamesList(DBsParent1); _jiguan = GetComponent <Map_AirJiguanGuais>(); print("机甲 自动地图 控制"); GetPlayer(); GetKuang(); OpenCamera(); CreateMaps(); ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.DAOJISHI, "239"), this);//239 CX = player_jijia.transform.position.x; print(" --------cundang!!! "); //直接存档 //ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.GAME_SAVEING, null), this); //GlobalSetDate.instance.GetSave(); }