void TouchDrag_OnPointerUpEvent(PointerEventData p, A_TouchDrag td) { if (this.state == ConstructionState.PLACING) { // Disable touch drag on pointer up. TouchDrag_Button tdb = (TouchDrag_Button)td; tdb.eventTrigger.enabled = false; // Drop the building. this.DropBuilding(this.selectedBuilding); } }
void TouchDrag_OnPointerDownEvent(PointerEventData p, A_TouchDrag td) { if (this.state == ConstructionState.SELECTING) { // Disable all further construction, except for current button. foreach (A_TouchDrag button in this.constructionButtons) { if (button != td) { button.eventTrigger.enabled = false; } } // Create the building passed by the touch drag button. TouchDrag_Button tdb = (TouchDrag_Button)td; if (tdb != null) { this.CreateBuilding(tdb.prefabToCreate); } } }