public override void Activate() { if (!active) { active = true; CommandStack.Push(commandMap); HelpOverlay.Push("RunSimulation"); // Wake everything up. parent.ActivateAllGameThings(); // This is commented out since it was removing Creatables from the level // when it shouldn't. In particular if you restart Kodu, find a level in // the LoadLevelMenu, and choose Edit, it would remove all the creatables. // Running and then editing would restore them so it's not peristing the // removal. // Normally I'd just delete the line but if this change starts causing issues // it might help to know this was here. If it's now 2019 or later you can // probably feel free to remove this. :-) //parent.RemoveCreatablesFromScene(); timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.InGameRunSim); #if !NETFX_CORE // Refresh the list of attached microbits. { System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(MicrobitManager.RefreshWorker)); t.Start(); } #endif // Be sure all Auth UI is hidden. AuthUI.HideAllDialogs(); base.Activate(); } if (Program2.CmdLine.Exists("analytics")) { #if !NETFX_CORE Console.WriteLine("Begin Analytics"); #endif ObjectAnalysis oa = new ObjectAnalysis(); oa.beginAnalysis(MainMenu.StartupWorldFilename.ToString()); // GamePadInput.stopActiveInputTimer(); //deactivate the menu on exit to stop the timer Deactivate(); // Wave bye, bye. #if NETFX_CORE Windows.UI.Xaml.Application.Current.Exit(); #else BokuGame.bokuGame.Exit(); #endif } } // end of RunSimUpdateObj Activate()
override public void Activate() { if (state != States.Active) { // Do stack handling here. If we do it in the update object we have no // clue which order things get pushed and popped and madness ensues. CommandStack.Push(commandMap); pendingState = States.Active; BokuGame.objectListDirty = true; saveChangesActivated = false; HelpOverlay.ToolIcon = null; InGame.inGame.RenderWorldAsThumbnail = true; timerInstrument = Instrumentation.StartTimer(Instrumentation.TimerId.MiniHubTime); Foley.PlayMenuLoop(); Time.Paused = true; AuthUI.ShowStatusDialog(); } }
public void Init(App app, GameSelectUI gameSelect, AuthUI auth, MenuUI menu) { this.app = app; this.gameSelect = gameSelect; this.auth = auth; this.menu = menu; }
} // end of TitleScreenMode Init() public void DoneLoadingContent() { if (progress != null) { progress.Complete(); progress = null; } updateObj.done = true; if (Program2.bShowVersionWarning) { Program2.bShowVersionWarning = false; GamePadInput.CreateNewerVersionDialog(); } if (BokuGame.Logon) { logonDialog.Activate(); } // Did we save the previous user? If so, restore. if (XmlOptionsData.KeepSignedInOnExit) { Auth.SetCreator(XmlOptionsData.CreatorName, XmlOptionsData.CreatorIdHash); } else { // Else, show the SignIn dialog. AuthUI.ShowSignInDialog(); } } // end of DoneLoadingContent()
public void Awake() { if (instance == null) { instance = this; } else if (instance != null) { Debug.Log("instance already exists, destroying object!"); Destroy(this); } }
//END DATABASE void Start() { // DATABASE https://engame-test.firebaseio.com/ FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://engame-test.firebaseio.com/"); // Get the root reference location of the database. reference = FirebaseDatabase.DefaultInstance.RootReference; // END DATABASE authUI = GetComponent <AuthUI>(); //auth = Firebase.Auth.FirebaseAuth.DefaultInstance; InitializeFirebase(); }
public override void Update() { if (AuthUI.IsModalActive) { return; } if (parent.newWorldDialog.Active) { parent.newWorldDialog.Update(); return; } // We need to do this ever frame instead of just at activation // time since deactivation of the previous scene and activation // of this scene don't always happen in that order. AuthUI.ShowStatusDialog(); parent.saveLevelDialog.Update(); shared.communityShareMenu.Update(); parent.saveChangesMessage.Update(); parent.saveChangesWithDiscardMessage.Update(); parent.shareSuccessMessage.Update(); parent.noCommunityMessage.Update(); // If any of the dialogs are active, we don't want to look for input. if (parent.saveLevelDialog.Active || parent.saveChangesMessage.Active || parent.saveChangesWithDiscardMessage.Active || parent.shareSuccessMessage.Active || parent.noCommunityMessage.Active ) { return; } // Ensure camera matches screen. shared.camera.Resolution = new Point((int)BokuGame.ScreenSize.X, (int)BokuGame.ScreenSize.Y); shared.camera.Update(); // Update menu. shared.menu.Update(shared.camera, ref shared.worldMatrix); // Ensure the help overlay is up to date. HelpOverlay.RefreshTexture(); } // end of MiniHub UpdateObj Update()
public static IModule RoleBased <TDomain, TUser, TRolesEnum, TLoginView>(TRolesEnum firstUserRole, Func <ControllerContext, ActionResult> unauthorizedResult, params IAuthProviderDefinition[] providers) where TUser : class, IRoleBasedUser <TRolesEnum>, new() where TLoginView : WebViewPage <LoginModel> { Contract.Requires <ArgumentException>(typeof(TRolesEnum).IsEnum, "Expected an enum"); Contract.Requires <ArgumentException>(typeof(TRolesEnum).GetCustomAttributes(typeof(FlagsAttribute), true).Length > 0, "Roles enum must must be [Flags]"); var getUser = GetByClaimedId <TDomain, TUser, TRolesEnum>(firstUserRole, OpenIdInfo, OAuthInfo); return(new ModuleBuilder() .Require(AuthUI.Module <TDomain, TUser, TLoginView>(getUser, getUser, providers) .ConfigRequest((IAuthenticationRequest r) => r.AddExtension(_stdFetchRequest))) .Export <IUserProvider <TUser>, UserProvider <TDomain, TUser, TRolesEnum> >() .Export <IMvcFilter, AuthenticationFilter <TUser, TRolesEnum> >() .Export(new RoleBasedAuthConfig <TRolesEnum> { FirstUserRole = firstUserRole, UnauthorizedResult = unauthorizedResult }) .CreateModule()); }
public override void Activate() { // If we have a level to resume, check for the crashed cookie. If we find the cookie // delete it and activate the dialog letting the user know they can recover the level. if (InGame.UnDoStack.HaveResume()) { if (Storage4.FileExists(MainMenu.CrashCookieFilename, StorageSource.UserSpace)) { Storage4.Delete(MainMenu.CrashCookieFilename); parent.prevSessionCrashedMessage.Activate(); } } // Force feed to refresh rendering. shared.liveFeed.Dirty = true; // Start showing the current, signed-in creator. AuthUI.ShowStatusDialog(); }
override public void Deactivate() { if (state != States.Inactive && pendingState != States.Inactive) { // Do stack handling here. If we do it in the update object we have no // clue which order things get pushed and popped and madness ensues. CommandStack.Pop(commandMap); HelpOverlay.Pop(); shared.menu.Active = false; pendingState = States.Inactive; BokuGame.objectListDirty = true; InGame.inGame.RenderWorldAsThumbnail = false; Instrumentation.StopTimer(timerInstrument); Foley.StopMenuLoop(); Time.Paused = false; AuthUI.HideAllDialogs(); } }
void Start() { Instrucciones = true; //Debug.Log("Entre1"); //StartCoroutine(Upload()); //Debug.Log("Entre2"); //Text_info.text = "Inicie"; //refeAuth.OcultarView(); General.SetActive(false); LinkBtn.SetActive(false); Btn_aceptar.SetActive(false); Text_text_Nivel.SetActive(false); //iden = gameObject.GetComponent<AuthManager>().userIdd.id; //iden = authManager.iden; //iden = gameObject.GetComponent<AuthManager>().ide; FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://engame-test.firebaseio.com/"); // Get the root reference location of the database. reference = FirebaseDatabase.DefaultInstance.RootReference; authUI = GetComponent <AuthUI>(); //auth = Firebase.Auth.FirebaseAuth.DefaultInstance; InitializeFirebase(); /**************/ start_time_h = DateTime.Now.Hour; start_time_m = DateTime.Now.Minute; start_time_s = DateTime.Now.Second; //puente.transform.positio //player.transform.position.x corx = 20; cory = -8; puente.SetActive(false); punt = 0; mesaje.text = "SCORE: " + punt; input = true; bander = true; coordenadaX = 0; coordenadaZ = 0; pushh = true; pushh2 = true; flagg = true; Screen.orientation = ScreenOrientation.Landscape; /*********************************************/ cubesPivotDistance = cubeSize * cubesInRow / 2; cubesPivot = new Vector3(cubesPivotDistance, cubesPivotDistance, cubesPivotDistance); /*********************************************/ speed = (float)0.015; timeStep = (float)1.0; flag_borde = false; bordes = new List <List <Vector2> >(); n_escenario = 0; /******************************/ complete = false; lista_aux = new List <Vector2> (); margen = new Vector2(8, -4); lista_aux.Add(margen); margen = new Vector2(-12, 0); lista_aux.Add(margen); margen = new Vector2(-12, 4); lista_aux.Add(margen); margen = new Vector2(-12, 8); lista_aux.Add(margen); margen = new Vector2(-12, 12); lista_aux.Add(margen); margen = new Vector2(-8, 16); lista_aux.Add(margen); margen = new Vector2(-4, 16); lista_aux.Add(margen); margen = new Vector2(0, 16); lista_aux.Add(margen); margen = new Vector2(4, 16); lista_aux.Add(margen); margen = new Vector2(8, 8); lista_aux.Add(margen); margen = new Vector2(8, 12); lista_aux.Add(margen); margen = new Vector2(8, 4); lista_aux.Add(margen); margen = new Vector2(12, 4); lista_aux.Add(margen); margen = new Vector2(16, 4); lista_aux.Add(margen); margen = new Vector2(20, 0); lista_aux.Add(margen); margen = new Vector2(24, 0); lista_aux.Add(margen); margen = new Vector2(28, -4); lista_aux.Add(margen); margen = new Vector2(24, -12); lista_aux.Add(margen); margen = new Vector2(20, -16); lista_aux.Add(margen); margen = new Vector2(16, -16); lista_aux.Add(margen); margen = new Vector2(12, -12); lista_aux.Add(margen); margen = new Vector2(8, -12); lista_aux.Add(margen); margen = new Vector2(4, -12); lista_aux.Add(margen); margen = new Vector2(0, -12); lista_aux.Add(margen); margen = new Vector2(-4, -8); lista_aux.Add(margen); margen = new Vector2(-8, -4); lista_aux.Add(margen); margen = new Vector2(0, 4); lista_aux.Add(margen); margen = new Vector2(0, 8); lista_aux.Add(margen); //margen = new Vector2(20, -8); lista_aux.Add(margen); margen = new Vector2(32, -4); lista_aux.Add(margen); margen = new Vector2(36, -4); lista_aux.Add(margen); margen = new Vector2(40, -4); lista_aux.Add(margen); margen = new Vector2(44, -8); lista_aux.Add(margen); margen = new Vector2(44, -12); lista_aux.Add(margen); margen = new Vector2(44, -16); lista_aux.Add(margen); margen = new Vector2(40, -20); lista_aux.Add(margen); margen = new Vector2(36, -20); lista_aux.Add(margen); margen = new Vector2(32, -20); lista_aux.Add(margen); margen = new Vector2(28, -16); lista_aux.Add(margen); margen = new Vector2(28, -12); lista_aux.Add(margen); //puente.SetActive(false); //ayuda.SetActive(false); bordes.Add(lista_aux); /***************** ESCENARIO II ************************/ escenario1 = new Vector2(20, 8); metas.Add(escenario1); /***************** ESCENARIO III ************************/ escenario1 = new Vector2(40, -12); metas.Add(escenario1); /***************** ESCENARIO IV ************************/ escenario1 = new Vector2(-12, -8); metas.Add(escenario1); IniciarBordes(); //margen = new Vector2(28, -8); lista_aux.Add(margen); Print_e(); }
void Awake() { auth = GameObject.FindObjectOfType <AuthUI>(); //escenaLogIn = GameObject.FindObjectOfType<EscenaLogIn>(); }
public override void Deactivate() { AuthUI.HideAllDialogs(); }
public override void Update() { shared.timer.Update(); // Keep Kodu animating even if a dialog is active. shared.boku.UpdateFace(); shared.boku.UpdateAnimations(); if (AuthUI.IsModalActive) { return; } if (parent.newWorldDialog.Active) { parent.newWorldDialog.Update(); return; } // If not modal, always show status. AuthUI.ShowStatusDialog(); // Update the dialogs. parent.prevSessionCrashedMessage.Update(); parent.noCommunityMessage.Update(); parent.noSharingMessage.Update(); // Don't do anything else until the user reads and dismisses the dialogs. if (parent.prevSessionCrashedMessage.Active || parent.exitingKodu) { return; } // Update the options menu. Do this first so that if it is active it can steal input. shared.optionsMenu.Update(); // Main menu should always be active. shared.menu.Active = true; // If OptionsMenu is active, don't look at input. This is a problem for touch input // which doesn't support any kind of "ClearAllWasPressedState" functionality. if (!shared.optionsMenu.Active) { // Check for click on signOut tile or url. if (MouseInput.Left.WasPressed || Actions.Select.WasPressed || TouchInput.WasTouched) { TouchContact touch = TouchInput.GetOldestTouch(); if (touch != null) { touch.position = ScreenWarp.ScreenToRT(touch.position); } Vector2 mouseHit = MouseInput.GetMouseInRtCoords(); // url is in rt coords. if (shared.urlBox.Contains(mouseHit) || (null != touch && shared.urlBox.Contains(touch.position))) { #if NETFX_CORE Launcher.LaunchUriAsync(new Uri(KoduGameLabUrl)); #else Process.Start(KoduGameLabUrl); #endif MouseInput.Left.ClearAllWasPressedState(); } } // Enable resume option if we have something to resume to. if (InGame.UnDoStack.HaveResume() && (shared.menu.Item(0) != Strings.Localize("mainMenu.resume"))) { shared.menu.InsertText(Strings.Localize("mainMenu.resume"), 0); } shared.liveFeed.UpdateFeed(); shared.liveFeed.Update(shared.camera); if (!UpdateNonMenuItems()) { // JW - Only update the menu and process input if the interactive non-menu // items didn't already handle the input. int curIndex = shared.menu.CurIndex; shared.menu.Update(shared.camera, ref shared.worldMatrix); int newIndex = shared.menu.CurIndex; // If the user made a menu change, have boku glance over. if (curIndex != newIndex) { shared.boku.DirectGaze(new Vector3(0.2f, -0.4f, 0.08f - 0.05f * newIndex), 0.5f); } } } if (Actions.MiniHub.WasPressed && InGame.XmlWorldData != null) { parent.Deactivate(); InGame.inGame.SwitchToMiniHub(); return; } #if IMPORT_DEBUG if (!string.IsNullOrEmpty(StartupWorldFilename)) { LevelPackage.DebugPrint("MainMenu"); LevelPackage.DebugPrint(" StartupWorldFilename : " + StartupWorldFilename); } #endif // Jump into the startup world, if it was specified. if (!String.IsNullOrEmpty(StartupWorldFilename)) { if (Storage4.FileExists(StartupWorldFilename, StorageSource.All)) { #if IMPORT_DEBUG LevelPackage.DebugPrint(" level exists, trying to load and run"); #endif if (BokuGame.bokuGame.inGame.LoadLevelAndRun(StartupWorldFilename, keepPersistentScores: false, newWorld: false, andRun: true)) { #if IMPORT_DEBUG LevelPackage.DebugPrint(" success on load and run"); #endif parent.Deactivate(); } #if IMPORT_DEBUG else { LevelPackage.DebugPrint(" fail to load and run"); } #endif shared.waitingForStorage = false; } #if IMPORT_DEBUG else { LevelPackage.DebugPrint(" level not found"); } #endif StartupWorldFilename = null; } // Set news feed state to opposite of options menu. This allows the // News Feed to "hide" when the Options Menu is active. if (shared.optionsMenu.Active) { shared.liveFeed.Deactivate(); } else { shared.liveFeed.Activate(); shared.liveFeed.UpdateFeed(); } } // end of Update()