public void Init() { Debug.Log("set up in buttonexecute"); dummy = new GameObject(); testObj = dummy.AddComponent <ButtonExecute>(); GameObject cam = new GameObject("Main camera", typeof(Camera)); testObj.CameraFacing = cam.GetComponent <Camera>(); }
private void ValidateFolders() { LabelStatus.Content = labelStatusStart + "Validating folder selections..."; bool validSteam = false, validWindowsAppStore = false, validBackup = false; if (System.IO.Directory.Exists(TextboxSteamFolder.Text)) { ValidationRectangleSteam.Visibility = Visibility.Hidden; ValidationRectangleSteam.UpdateLayout(); validSteam = true; } else if (ValidationRectangleSteam.Visibility == Visibility.Hidden) { ValidationRectangleSteam.Visibility = Visibility.Visible; ValidationRectangleSteam.UpdateLayout(); } if (System.IO.Directory.Exists(TextboxWindowsAppStoreFolder.Text)) { ValidationRectangleWindowsAppStore.Visibility = Visibility.Hidden; ValidationRectangleWindowsAppStore.UpdateLayout(); validWindowsAppStore = true; } else if (ValidationRectangleWindowsAppStore.Visibility == Visibility.Hidden) { ValidationRectangleWindowsAppStore.Visibility = Visibility.Visible; ValidationRectangleWindowsAppStore.UpdateLayout(); } if (System.IO.Directory.Exists(TextboxBackupFolder.Text)) { ValidationRectangleBackup.Visibility = Visibility.Hidden; ValidationRectangleBackup.UpdateLayout(); validBackup = true; } else if (ValidationRectangleBackup.Visibility == Visibility.Hidden) { ValidationRectangleBackup.Visibility = Visibility.Visible; ValidationRectangleBackup.UpdateLayout(); } if (validSteam && validWindowsAppStore && validBackup) { ButtonExecute.IsEnabled = true; ButtonExecute.UpdateLayout(); } else if (ButtonExecute.IsEnabled) { ButtonExecute.IsEnabled = false; ButtonExecute.UpdateLayout(); } LabelStatus.Content = labelStatusStart + "Validation complete. Steam folder: " + (validSteam ? "Exists." : "Does not exist.") + " Windows App Store folder: " + (validWindowsAppStore ? "Exists." : "Does not exist.") + " Backup folder: " + (validBackup ? "Exists." : "Does not exist."); }