Exemplo n.º 1
0
 public void OnGUI()
 {
     EditorGUI.DrawRect (new Rect (0, 0, position.width, position.height), View.Render.Lerped);
     if (Event.current.type == EventType.Layout) {
         currentPage = Controller.PluginController.Instance.PageFromState ();
     }
     currentPage.Render (Instance.position);
 }
Exemplo n.º 2
0
		public KitControllerStatus PageFromState(out Page page)
		{
			if (Settings.Instance.InstalledKits.Exists (kit => kit.Name.Equals (Name) && kit.Installed)) {
				page = Dashboard;
				return KitControllerStatus.NextPage;
			}
			
			page = null;
			switch (Settings.Instance.FlowSequence) {
			case 0:
				page = Instructions;
				break;
			case 1:
				page = Prefab;
				break;
			case 2:
				return KitControllerStatus.LastPage;
			}
			
			return KitControllerStatus.NextPage;
		}
Exemplo n.º 3
0
 public PluginController()
 {
     login = new LoginPage (Login ());
     orgs = new OrganizationsPage (SelectOrganization (), FetchOrganizationsAsync);
     validation = new ValidationPage (BackToKitSelection, SetSelectedKitConfigured);
     kitSelection = new KitSelectionPage (
         ListAvailableOnboardableKits,
         KitUtils.ListImportedKits (Api),
         SelectKit (),
         ActivationCheck,
         BackToOrganizations (),
         Update.PeriodicUpdateManager.IsPluginUpdateAvailable,
         ShowUpdatePage (() => { return LatestPluginConfig; }, UpdateFlow.Plugin)
     );
     updatePage = new UpdatePage (InitiateUpdate, BackToKitSelection,
         delegate() {
             return String.IsNullOrEmpty (Settings.Instance.Kit) ? "Fabric Plugin" : Settings.Instance.Kit;
         },
         delegate () {
             return fabricInstaller.FetchReleaseNotes ();
         }
     );
     conflictPage = new ConflictResolutionPage (
         (string conflictWith) => {
             Settings.Instance.Conflict = conflictWith;
             BackToKitSelection ();
         },
         SelectKit (),
         ListAvailableOnboardableKits (),
         ConflictAgent,
         GetConflictingDependenciesFor
     );
     manualInitialization = new ManualInitializationPage (BackToKitSelection, (Settings.InitializationType type) => {
         Settings.Instance.Initialization = type;
     }, () => {
         Application.OpenURL ("https://docs.fabric.io/unity/index.html");
     }, () => {
         return Settings.Instance.Initialization;
     });
 }
Exemplo n.º 4
0
 private KitControllerStatus ShowInstalledPage(out Page page)
 {
     page = Dashboard;
     return KitControllerStatus.NextPage;
 }
Exemplo n.º 5
0
 private KitControllerStatus ShowInstallationFlowPage(int flowSequence, out Page page)
 {
     switch (flowSequence) {
     case 0:
         page = Instructions;
         return KitControllerStatus.NextPage;
     case 1:
         page = Prefab;
         return KitControllerStatus.NextPage;
     default:
         return ShowConfiguredPage (out page);
     }
 }
Exemplo n.º 6
0
 private KitControllerStatus ShowConfiguredPage(out Page page)
 {
     page = null;
     return KitControllerStatus.LastPage;
 }
Exemplo n.º 7
0
        public KitControllerStatus PageFromState(out Page page)
        {
            List<Settings.InstalledKit> installedKits = Settings.Instance.InstalledKits;
            Settings.InstalledKit crashlyticsKit = installedKits.Find (kit => kit.Name.Equals (Name, StringComparison.OrdinalIgnoreCase));

            switch (crashlyticsKit.InstallationStatus) {
            case Settings.KitInstallationStatus.Installed:
                return ShowInstalledPage (out page);
            case Settings.KitInstallationStatus.Imported:
                return ShowInstallationFlowPage (Settings.Instance.FlowSequence, out page);
            case Settings.KitInstallationStatus.Configured:
            default:
                return ShowConfiguredPage (out page);
            }
        }
		public PluginController()
		{
			login = new LoginPage (Login ());
			orgs = new OrganizationsPage (SelectOrganization (), FetchOrganizationsAsync);
			validation = new ValidationPage (QueryForActivation (), ResetActivationStatus ());
			kitSelection = new KitSelectionPage (
				ListAvailableKits,
				KitUtils.ListImportedKits (Api),
				DisplayedKitStatusAndVersion,
				SelectKit (),
				BackToOrganizations (),
				Update.PeriodicUpdateManager.IsPluginUpdateAvailable,
				ShowUpdatePage (() => { return LatestPluginConfig; }, UpdateFlow.Plugin)
			);
			updatePage = new UpdatePage (InitiateUpdate, BackToKitSelection, 
				delegate() {
					return String.IsNullOrEmpty (Settings.Instance.Kit) ? "Fabric Plugin" : Settings.Instance.Kit;
				},
				delegate () {
					return fabricInstaller.FetchReleaseNotes ();
				}
			);
		}