private NestElement InstantiateLShapeRoad(EnumRoadDirection direction) { var roadData = new LShapeRoadData(direction); // roadData.IsUnderConstruction = true; return(NestSystem.Instance.InstantiateNestElement(roadData)); }
public void PushDown() { position = Input.mousePosition; position.z = 10f; screenToWorldPointPosition = Camera.main.ScreenToWorldPoint(position); //Listでシーン内にあるNestElementをすべて取得 var list = NestSystem.Instance.NestElements; //貯蓄庫と女王の部屋の数を数えます for (int i = 0; i < list.Count; i++) { if (list[i].GetType().Name == "StoreRoom") { Chochikukonum++; } else if (list[i].GetType().Name == "QueenRoom")//仮の名前 { QweenRoomNum++; } } //出現させるNestElementのデータを保存 NestElementData data; if (NestName == "IShapeVertical") { data = new IShapeRoadData(EnumRoadHVDirection.Vertical) { IsUnderConstruction = true }; } else if (NestName == "IShapeHorizontal") { data = new IShapeRoadData(EnumRoadHVDirection.Horizontal) { IsUnderConstruction = true }; } else if (NestName == "LShapeBottom") { data = new LShapeRoadData(EnumRoadDirection.Bottom) { IsUnderConstruction = true }; } else if (NestName == "LShapeRight") { data = new LShapeRoadData(EnumRoadDirection.Right) { IsUnderConstruction = true }; } else if (NestName == "LShapeTop") { data = new LShapeRoadData(EnumRoadDirection.Top) { IsUnderConstruction = true }; } else if (NestName == "LShapeLeft") { data = new LShapeRoadData(EnumRoadDirection.Left) { IsUnderConstruction = true }; } else if (NestName == "TShapeBottom") { data = new TShapeRoadData(EnumRoadDirection.Bottom) { IsUnderConstruction = true }; } else if (NestName == "TShapeRight") { data = new TShapeRoadData(EnumRoadDirection.Right) { IsUnderConstruction = true }; } else if (NestName == "TShapeTop") { data = new TShapeRoadData(EnumRoadDirection.Top) { IsUnderConstruction = true }; } else if (NestName == "TShapeLeft") { data = new TShapeRoadData(EnumRoadDirection.Left) { IsUnderConstruction = true }; } else if (NestName == "Chochikubeya" && Chochikukonum == 0) { //data = new ChochikubeyaData(); data = new StoreRoomData() { IsUnderConstruction = true }; } else if (NestName == "QueenRoom" && QweenRoomNum == 0) { //data = new QweenAntRoomData(); data = new QueenRoomData() { IsUnderConstruction = true }; } else if (NestName == "Cross") { data = new CrossShapeRoadData() { IsUnderConstruction = true }; } else { data = new CrossShapeRoadData(); } //貯蓄庫と女王の部屋が指定されたときシーン内に巣でにそれらの部屋があるなら出せない if ((NestName == "Chochikubeya" && Chochikukonum != 0) || (NestName == "QueenRoom" && QweenRoomNum != 0)) { GetComponent <EventTrigger>().triggers.Clear(); } else { nestelement = NestSystem.Instance.InstantiateNestElement(data, false, false); nestelement.transform.position = screenToWorldPointPosition; (nestelement as NestBuildableElement).SetImage(EnumNestImage.Spector); } }
public void PushDown() { position = Input.mousePosition; position.z = 10f; screenToWorldPointPosition = Camera.main.ScreenToWorldPoint(position); //Listでシーン内にあるNestElementをすべて取得 var list = NestSystem.Instance.NestElements; //貯蓄庫と女王の部屋の数を数えます for (int i = 0; i < list.Count; i++) { if (list[i].gameObject.name == "Chochikubeya(Clone)") { Chochikukonum++; } else if (list[i].gameObject.name == "QweenAntRoom(Clone)")//仮の名前 { QweenRoomNum++; } } //出現させるNestElementのデータを保存 NestElementData data; if (NestName == "IShapeVertical") { data = new IShapeRoadData(EnumRoadHVDirection.Vertical); } else if (NestName == "IShapeHorizontal") { data = new IShapeRoadData(EnumRoadHVDirection.Horizontal); } else if (NestName == "LShapeBottom") { data = new LShapeRoadData(EnumRoadDirection.Bottom); } else if (NestName == "LShapeRight") { data = new LShapeRoadData(EnumRoadDirection.Right); } else if (NestName == "LShapeTop") { data = new LShapeRoadData(EnumRoadDirection.Top); } else if (NestName == "LShapeLeft") { data = new LShapeRoadData(EnumRoadDirection.Left); } else if (NestName == "TShapeBottom") { data = new TShapeRoadData(EnumRoadDirection.Bottom); } else if (NestName == "TShapeRight") { data = new TShapeRoadData(EnumRoadDirection.Right); } else if (NestName == "TShapeTop") { data = new TShapeRoadData(EnumRoadDirection.Top); } else if (NestName == "TShapeLeft") { data = new TShapeRoadData(EnumRoadDirection.Left); } else if (NestName == "Chochikubeya") { //data = new ChochikubeyaData(); data = new CrossShapeRoadData(); } else if (NestName == "QweenAntRoom") { //data = new QweenAntRoomData(); data = new CrossShapeRoadData(); } else if (NestName == "Cross") { data = new CrossShapeRoadData(); } else { data = new CrossShapeRoadData(); } //貯蓄庫と女王の部屋が指定されたときシーン内に巣でにそれらの部屋があるなら出せない if ((NestName == "Chochikubeya" && Chochikukonum != 0) || (NestName == "QweenAntRoom" && QweenRoomNum != 0)) { } else { nestelement = NestSystem.Instance.InstantiateNestElement(data); nestelement.transform.position = screenToWorldPointPosition; } }
private NestElement InstantiateLShapeRoad(EnumRoadDirection direction) { var roadData = new LShapeRoadData(direction); return(NestSystem.Instance.InstantiateNestElement(roadData)); }