Answers for "press button with and have confirm unity"

C#
1

press button with and have confirm unity

IEnumerator PlaceBuilding()
{
   // whatever you're doing now with the temporary / placement preview building
 
   ConfirmationDialog dialog = ShowConfirmationDialog(); // instantiate the UI dialog box
 
   while(dialog.result == DialogResult.None)
       yield return null; // wait
 
   if(dialog.result == DialogResult.Yes)
   {
       // place the real building
   }
   else if(dialog.result == DialogResult.Cancel)
   {
       // remove the temporary / preview building
   }
}
Posted by: Guest on November-22-2020

C# Answers by Framework

Browse Popular Code Answers by Language