private void onStateChanged(TrayInputButton.ButtonState buttonState)
 {
     if (buttonState != 0)
     {
         containerAnimator.ResetTrigger(EXIT_TRIGGER);
         containerAnimator.SetTrigger(INTRO_TRIGGER);
     }
     else
     {
         containerAnimator.ResetTrigger(INTRO_TRIGGER);
         containerAnimator.SetTrigger(EXIT_TRIGGER);
     }
 }
    public void SetUpButton(TrayInputButton trayInputButton)
    {
        GameObject gameObject = Object.Instantiate(ButtonPrefab);

        gameObject.transform.SetParent(trayInputButton.Behaviour.transform, worldPositionStays: false);
        if (trayInputButton.IconSprite != null && trayInputButton.IconTint != null)
        {
            trayInputButton.Icon.enabled       = true;
            trayInputButton.IconSprite.Sprites = new Sprite[ButtonIcons.Length];
            trayInputButton.IconTint.Colors    = new Color[ButtonIcons.Length];
            for (int i = 0; i < ButtonIcons.Length; i++)
            {
                trayInputButton.IconSprite.Sprites[i] = ButtonIcons[i];
                trayInputButton.IconTint.Colors[i]    = IconTints[i];
            }
            trayInputButton.IconSprite.SelectSprite((int)DefaultState);
            trayInputButton.IconTint.SelectColor((int)DefaultState);
        }
        else
        {
            trayInputButton.Icon.enabled = false;
            Log.LogError(this, "Button object did not have an icon sprite or tint selector");
        }
        trayInputButton.DefaultState        = DefaultState;
        trayInputButton.IsBackgroundVisible = IsBackgroundVisible;
        if (!IsBackgroundVisible)
        {
            trayInputButton.GetComponent <Image>().enabled = false;
        }
        TrayInputButton.ButtonState buttonVisualState = DefaultState;
        TrayInputButton.ButtonState buttonState       = DefaultState;
        if (trayInputButton.IsLocked)
        {
            buttonVisualState = trayInputButton.CurrentViewState;
            buttonState       = TrayInputButton.ButtonState.Disabled;
        }
        trayInputButton.InitializeView(DefaultState, buttonVisualState);
        trayInputButton.GetComponent <Button>().interactable = (buttonState != TrayInputButton.ButtonState.Disabled);
        trayInputButton.gameObject.SetActive(value: true);
    }
Beispiel #3
0
 private void onButtonClicked()
 {
     previousState = trayInputButton.CurrentState;
     trayInputButton.SetState(TrayInputButton.ButtonState.Disabled);
     CoroutineRunner.Start(delayedCooldown(), this, "delayedCooldown");
 }
Beispiel #4
0
 private void onTrayInputButtonStateChanged(TrayInputButton.ButtonState state)
 {
 }
Beispiel #5
0
 public void OnButtonStateChanged(TrayInputButton.ButtonState buttonState)
 {
     dispatcher.DispatchEvent(new InputEvents.ActionEnabledEvent(Action, buttonState != TrayInputButton.ButtonState.Disabled));
 }