void Start()
 {
     m_audioSource   = GetComponent<AudioSource>();
     m_Collider      = GetComponent<Collider2D>();
     jukebox         = FindObjectOfType<ComposerBehaviour>();
     m_playerSpeed   = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>().RunSpeed;
     m_DebugRay      = (transform.right * m_playerSpeed * m_audioSource.clip.length);
     m_UIBehavior    = FindObjectOfType<UIBehavior>();
 }
    void Start()
    {
        GameObject uiCanvas = GameObject.FindGameObjectWithTag("UICanvas");

        if (uiCanvas != null)
        {
            uiBehavior = uiCanvas.GetComponent <UIBehavior>();
            if (uiBehavior == null)
            {
                throw new Exception("Error: UICanvas has no UIBehavior component!");
            }
        }
    }
示例#3
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        UpdateUIKeys(false, false, false);
    }
 public NonInteractiveRegisterAccountRequest(
     IServiceBundle serviceBundle,
     AuthenticationRequestParameters authenticationRequestParameters,
     ApiEvent.ApiIds apiId,
     IEnumerable <string> extraScopesToConsent,
     string loginHint,
     UIBehavior uiBehavior,
     IWebUI webUi,
     string email)
     : base(serviceBundle, authenticationRequestParameters, apiId, extraScopesToConsent, loginHint, uiBehavior, webUi)
 {
     Init(email);
 }
示例#5
0
 public NonInteractiveLoginRequest(
     IServiceBundle serviceBundle,
     AuthenticationRequestParameters authenticationRequestParameters,
     ApiEvent.ApiIds apiId,
     IEnumerable <string> extraScopesToConsent,
     string loginHint,
     UIBehavior uiBehavior,
     IWebUI webUi,
     string userName,
     string password)
     : base(serviceBundle, authenticationRequestParameters, apiId, extraScopesToConsent, loginHint, uiBehavior, webUi)
 {
     Init(userName, password);
 }
示例#6
0
 void OnMouseDown()
 {
     if (charUIInstance == null)
     {
         charUIInstance = Instantiate(charUI) as GameObject;
         UIBehavior script = charUIInstance.GetComponent <UIBehavior>();
         script.setContent(s, maxHealth, curHealth, characterName);
     }
     else
     {
         Destroy(charUIInstance);
         charUIInstance = null;
     }
 }
示例#7
0
 public InteractiveRequest(
     IServiceBundle serviceBundle,
     AuthenticationRequestParameters authenticationRequestParameters,
     ApiEvent.ApiIds apiId,
     IEnumerable <string> extraScopesToConsent,
     UIBehavior uiBehavior,
     IWebUI webUi)
     : this(
         serviceBundle,
         authenticationRequestParameters,
         apiId,
         extraScopesToConsent,
         authenticationRequestParameters.Account?.Username,
         uiBehavior,
         webUi)
 {
 }
示例#8
0
    protected override void Die()
    {
        anim.SetTrigger("TDie");
        PlaySound();
        GameObject.Destroy(gameObject, 1f);
        this.isDead = true;
        //TODO: Show Game Over screen

        /*UnityEngine.SceneManagement.Scene scene = UnityEngine.SceneManagement.SceneManager.GetActiveScene(); //current scene
         * UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(scene.name, LoadSceneMode.Single);*/
        GameObject uiCanvas = GameObject.FindGameObjectWithTag("UICanvas");

        if (uiCanvas != null)
        {
            UIBehavior uiBehavior = uiCanvas.GetComponent <UIBehavior>();
            uiBehavior.GameOver();
        }
    }
示例#9
0
        private void Finish(string playerName, string v)
        {
            TextBlock t = new TextBlock {
                HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Height = 100, Foreground = Color.Black, Margin = new Thickness(0, 0, 0, 0), Width = 400, Text = playerName + " wins", TextAlignment = TextAlignment.Center
            };

            Owner.Scene.EntityManager.Add(t);

            TextBlock t2 = new TextBlock {
                HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Height = 100, Foreground = Color.Black, Margin = new Thickness(0, 0, 0, 50), Width = 400, Text = v, TextAlignment = TextAlignment.Center
            };

            Owner.Scene.EntityManager.Add(t2);
            WaveServices.Layout.PerformLayout();
            Owner.Scene.Pause();
            WaveServices.TimerFactory.CreateTimer(TimeSpan.FromSeconds(3), () =>
            {
                UIBehavior.Reload(Owner.Scene.GetType());
            }, false);
        }
示例#10
0
        private UIBehavior GetUIBehavior()
        {
            UIBehavior behavior = UIBehavior.SelectAccount;

            if (forceLogin.Checked)
            {
                behavior = UIBehavior.ForceLogin;
            }

            if (never.Checked)
            {
                behavior = UIBehavior.Never;
            }

            if (consent.Checked)
            {
                behavior = UIBehavior.Consent;
            }

            return(behavior);
        }
示例#11
0
        protected override void Update(TimeSpan gameTime)
        {
            if (!started)
            {
                started = true;
                UIBehavior       ui    = Scene.EntityManager.Find("camera2D").FindComponent <UIBehavior>();
                Entity           p     = ui.CreateToTile("Person", 3, 3);
                List <LayerTile> tiles = new List <LayerTile>();
                tiles.Add(Map.map.GetTileByMapCoordinates(3, 3));
                tiles.Add(Map.map.GetTileByMapCoordinates(2, 3));
                tiles.Add(Map.map.GetTileByMapCoordinates(2, 2));
                tiles.Add(Map.map.GetTileByMapCoordinates(2, 1));
                p.FindComponent <MovementBehavior>().SetPath(tiles);


                p = ui.CreateToTile("Trap", 2, 2);

                ui.playerButtons[1].IsChecked = true;

                p = ui.CreateToTile("Trap", 2, 3);
            }
        }
示例#12
0
        protected override void Update(TimeSpan gameTime)
        {
            if (!started)
            {
                started = true;

                UIBehavior ui = UIBehavior.ui;


                Entity p = ui.CreateToTile("Person", 3, 3);


                List <LayerTile> tiles = new List <LayerTile>();
                tiles.Add(Map.map.GetTileByMapCoordinates(3, 3));
                tiles.Add(Map.map.GetTileByMapCoordinates(2, 3));
                tiles.Add(Map.map.GetTileByMapCoordinates(2, 2));
                tiles.Add(Map.map.GetTileByMapCoordinates(2, 1));
                tiles.Add(Map.map.GetTileByMapCoordinates(3, 1));
                p.FindComponent <MovementBehavior>().SetPath(tiles);
                p = ui.CreateToTile("FakeTree", 2, 2);

                ui.playerButtons[1].IsChecked = true;

                p = ui.CreateToTile("FakeTree", 1, 2);
                p = ui.CreateToTile("Person", 1, 1);

                tiles = new List <LayerTile>();
                tiles.Add(Map.map.GetTileByMapCoordinates(1, 1));
                tiles.Add(Map.map.GetTileByMapCoordinates(1, 2));
                tiles.Add(Map.map.GetTileByMapCoordinates(2, 2));
                tiles.Add(Map.map.GetTileByMapCoordinates(2, 1));
                tiles.Add(Map.map.GetTileByMapCoordinates(2, 0));
                tiles.Add(Map.map.GetTileByMapCoordinates(1, 0));
                tiles.Add(Map.map.GetTileByMapCoordinates(0, 0));
                tiles.Add(Map.map.GetTileByMapCoordinates(0, 1));
                p.FindComponent <MovementBehavior>().SetPath(tiles);
            }
        }
示例#13
0
    private UIBehavior ui;                                                  // ui is holding time value, we need to access it to save time per section value

    // Use this for initialization
    void Start()
    {
        ui = GameObject.Find("UI").GetComponent <UIBehavior>();
        if (ui == null)
        {
            Debug.LogError("couldn't locate UI");
        }
        renderer = GetComponent <Renderer>();

        active = firstCheckpoint;

        restartCheckpoint = null;

        if (firstCheckpoint)
        {
            renderer.material = activeCheckpointMaterial;
        }

        if (nextCheckpoint == null)
        {
            finalCheckpoint = true;
        }
    }
        public InteractiveRequest(AuthenticationRequestParameters authenticationRequestParameters,
                                  IEnumerable <string> extraScopesToConsent, string loginHint,
                                  UIBehavior UIBehavior, IWebUI webUI)
            : base(authenticationRequestParameters)
        {
            PlatformPlugin.PlatformInformation.ValidateRedirectUri(authenticationRequestParameters.RedirectUri,
                                                                   authenticationRequestParameters.RequestContext);
            if (!string.IsNullOrWhiteSpace(authenticationRequestParameters.RedirectUri.Fragment))
            {
                throw new ArgumentException(MsalErrorMessage.RedirectUriContainsFragment, nameof(authenticationRequestParameters.RedirectUri));
            }

            _extraScopesToConsent = new SortedSet <string>();
            if (!MsalHelpers.IsNullOrEmpty(extraScopesToConsent))
            {
                _extraScopesToConsent = extraScopesToConsent.CreateSetFromEnumerable();
            }

            ValidateScopeInput(_extraScopesToConsent);

            authenticationRequestParameters.LoginHint = loginHint;
            if (!string.IsNullOrWhiteSpace(authenticationRequestParameters.ExtraQueryParameters) &&
                authenticationRequestParameters.ExtraQueryParameters[0] == '&')
            {
                authenticationRequestParameters.ExtraQueryParameters =
                    authenticationRequestParameters.ExtraQueryParameters.Substring(1);
            }

            _webUi        = webUI;
            _UIBehavior   = UIBehavior;
            LoadFromCache = false; //no cache lookup and refresh for interactive.
            var msg = "Additional scopes - " + _extraScopesToConsent.AsSingleString() + ";" + "UIBehavior - " +
                      _UIBehavior.PromptValue;

            AuthenticationRequestParameters.RequestContext.Logger.Info(msg);
            AuthenticationRequestParameters.RequestContext.Logger.InfoPii(msg);
        }
示例#15
0
        public async Task <AuthenticationResult> AcquireTokenInteractiveWithAuthorityAsync(
            IEnumerable <string> scopes,
            UIBehavior uiBehavior,
            string extraQueryParams,
            UIParent uiParent)
        {
            CreateOrUpdatePublicClientApp(InteractiveAuthority, ApplicationId);

            AuthenticationResult result;

            if (CurrentUser != null)
            {
                result = await PublicClientApplication.AcquireTokenAsync(
                    scopes,
                    CurrentUser,
                    uiBehavior,
                    extraQueryParams,
                    null,
                    AuthorityOverride,
                    uiParent).ConfigureAwait(false);
            }
            else
            {
                result = await PublicClientApplication.AcquireTokenAsync(
                    scopes,
                    LoginHint,
                    uiBehavior,
                    extraQueryParams,
                    null,
                    AuthorityOverride,
                    uiParent).ConfigureAwait(false);
            }

            CurrentUser = result.Account;
            return(result);
        }
示例#16
0
    /// <summary>
    /// Checks whether the player can equip the item
    /// </summary>
    /// <param name="obj">The Player's GameObject that wants to execute this action.</param>
    /// <returns>Return false if the item cannot be equipped, or if there is no item in the slot.</returns>
    public override bool Validate(GameObject obj)
    {
        bool equipItem = Input.GetButtonDown("EquipItem");

        if (equipItem)
        {
            GameObject UICanvas = GameObject.FindGameObjectWithTag("UICanvas");
            UIBehavior uib      = UICanvas.GetComponent <UIBehavior>();
            if (!uib.inventoryPanel.activeSelf)
            {
                return(false);
            }
            else
            {
                invPanel = GameObject.FindGameObjectWithTag("InventoryPanel").GetComponent <InventoryPanel>();
                toEquip  = invPanel.GetSelectedItem().clone();
                return(toEquip != null && (toEquip is EquippableItem || toEquip is UsableItem) && toEquip.SetYet());
            }
        }
        else
        {
            return(false);
        }
    }
示例#17
0
 void Awake()
 {
     _instance = this;
     //HomeScreen.SetActive (false);
     MessageScreen.SetActive(true);
 }
示例#18
0
        public async Task <AuthenticationResult> AcquireTokenInteractive(string[] scopes, UIBehavior uiBehavior, string extraQueryParams, UIParent uiParent)
        {
            CreatePublicClientApplication(InteractiveAuthority, ApplicationId);

            AuthenticationResult result;

            if (CurrentUser != null)
            {
                result = await PublicClientApplication.AcquireTokenAsync(scopes, CurrentUser, uiBehavior,
                                                                         extraQueryParams,
                                                                         uiParent);
            }
            else
            {
                result =
                    await PublicClientApplication.AcquireTokenAsync(scopes, LoginHint, uiBehavior,
                                                                    extraQueryParams,
                                                                    uiParent);
            }

            CurrentUser = result.User;
            return(result);
        }
示例#19
0
 protected override void ResolveDependencies()
 {
     base.ResolveDependencies();
     uibehavior = Owner.FindComponent <UIBehavior>();
 }
示例#20
0
 protected override void Initialize()
 {
     base.Initialize();
     ui = RenderManager.ActiveCamera2D.Owner.FindComponent <UIBehavior>();
 }
示例#21
0
 private void Close(object sender, EventArgs e)
 {
     Cancel();
     UIBehavior.Reload(previousScene);
 }
示例#22
0
 public void SetGUIReferences(UIBehavior uiBehavior, InventoryPanel panelScript)
 {
     this.uiBehavior = uiBehavior;
     this.panelScript = panelScript;
 }