Inheritance: MonoBehaviour
Beispiel #1
0
    private void Construct(IBuildLoadState _state,
                           [Inject(Id = "Content")] RectTransform _contentRect,
                           [Inject(Id = "LoadButton")] Button _loadButton,
                           [Inject(Id = "CancelButton")] Button _cancelButton,
                           [Inject(Id = "RaceButton")] Button _raceButton,
                           Settings _settings)
    {
        m_selected = null;
        m_state    = _state;
        ((State)m_state).m_enteredState += LoadList;
        ((State)m_state).m_exitedState  += Unload;
        m_fader = GetComponent <UIFader> ();
        m_fader.RegisterStateCallbacks((State)m_state);

        m_contentRect             = _contentRect;
        m_loadButton              = _loadButton;
        m_loadButton.interactable = false;
        m_loadButton.onClick.AddListener(OnEditPressed);
        _cancelButton.onClick.AddListener(OnCancelPressed);
        m_raceButton = _raceButton;
        m_raceButton.interactable = false;
        m_raceButton.onClick.AddListener(OnRacePressed);
        m_settings = _settings;

        gameObject.SetActive(false);
    }
Beispiel #2
0
    private void Construct(IBuildSaveState _state,
                           [Inject(Id = "TextValidateOutput")] Text _validateOutputText,
                           [Inject(Id = "InputName")] InputField _inputNameField,
                           [Inject(Id = "ButtonSaveTrack")] Button _saveButton,
                           [Inject(Id = "ButtonCancel")] Button _cancelButton,
                           [Inject(Id = "ButtonShare")] Button _shareButton,
                           DialogBuilder.Factory _dialogBuilderFactory,
                           IBuildStateMachine _buildSM,
                           UpdateUseCase _useCase)
    {
        m_state   = _state;
        m_session = _buildSM;
        m_useCase = _useCase;
        m_fader   = GetComponent <UIFader> ();
        m_fader.RegisterStateCallbacks(( State )m_state);

        m_validateOutputText      = _validateOutputText;
        m_validateOutputText.text = "Please enter a name for the Track";
        m_inputNameField          = _inputNameField;
        m_inputNameField.onValueChanged.AddListener(OnValueChanged);
        m_inputNameField.text = "";
        m_saveButton          = _saveButton;
        m_saveButton.onClick.AddListener(OnSaveButtonPressed);
        m_saveButton.interactable = false;
        _cancelButton.onClick.AddListener(OnCancelButtonPressed);
        m_dialogBuilderFactory = _dialogBuilderFactory;
        _shareButton.onClick.AddListener(OnShareButtonPressed);

        gameObject.SetActive(false);
    }
Beispiel #3
0
    private void StartClick()
    {
        UIFader fader = movePanel.GetComponent <UIFader>();

        fader.FadeOut();
        fader.OnOffRayCast(false);
    }
    private IEnumerator ChaliceAnimation()
    {
        CurrentRoom currentRoom    = FindObjectOfType <CurrentRoom>();
        Vector2     currentRoomPos =
            currentRoom.GetCurrentRoomCoordinate().GetRoomWorldPosition();
        GameObject curtainsGameObject =
            Instantiate(curtains.gameObject,
                        currentRoomPos,
                        Quaternion.identity);

        player = FindObjectOfType <Player>();
        player.FreezePlayer();
        player.transform.position =
            FindObjectOfType <CurrentRoom>().
            GetCurrentRoomCoordinate().
            GetRoomWorldPosition();
        player.GetComponent <SpriteRenderer>().sortingLayerID = SortingLayer.NameToID("AboveAll");
        Animator playerAnimator = player.GetComponent <Animator>();

        playerAnimator.SetTrigger("chalice");
        // Moves Chalice above player
        this.transform.position =
            (Vector2)player.transform.position + new Vector2(0, 1f);
        this.GetComponent <SpriteRenderer>().sortingLayerID = SortingLayer.NameToID("AboveAll");
        whiteFader = GameObject.Find("FaderWhite").GetComponent <UIFader>();
        yield return(new WaitForSeconds(.5f));

        Coroutine a = StartCoroutine(whiteFader.FadeCanvasGroupDistinct(whiteShineAlpha, shineTime));

        yield return(a);

        yield return(new WaitForSeconds(2f));

        Coroutine b = StartCoroutine(curtainsGameObject.GetComponent <Curtains>().CloseCurtains());
    }
Beispiel #5
0
 private void Start()
 {
     mainCamera  = FindObjectOfType <CameraMovement>();
     player      = FindObjectOfType <Player>();
     currentRoom = FindObjectOfType <CurrentRoom>();
     fader       = GameObject.Find("FaderBlack").GetComponent <UIFader>();
 }
 public void Select()
 {
     StartCoroutine(UIFader.FadeIn(2));
     FlashlightGO.SetActive(true);
     AnimationComp.Play(DrawAnim);
     isSelected = true;
 }
    private void Construct(ICalibrateState _state,
                           ARPlaneManager _planeManager,
                           ARPointCloudManager _pointCloudManager,
                           Settings _settings,
                           DialogBuilder.Factory _dialogBuilderFactory)
    {
        m_state                = _state;
        m_settings             = _settings;
        m_planeManager         = _planeManager;
        m_pointCloudManager    = _pointCloudManager;
        m_dialogBuilderFactory = _dialogBuilderFactory;

        UIFader fader = GetComponent <UIFader> ();

        fader.RegisterStateCallbacks((State)_state);
        ((State)_state).m_enteredState += Reset;

        m_planeSatisfaction = new ReactiveProperty <int> ();
        m_pointSatisfaction = new ReactiveProperty <int> ();

        m_resetButton.onClick.AddListener(Reset);
        m_skipButton.onClick.AddListener(OnSkipButtonPressed);

        gameObject.SetActive(false);
    }
    //Find all of our resources
    void Reset()
    {
        damageImage = GameObject.Find("DamagedFlash").GetComponent <UIFader>();

        allText    = GameObject.Find("AllText").GetComponent <Text>();
        deathAudio = GameObject.Find("DeathAudio").GetComponent <AudioSource>();
    }
 public override void Reset()
 {
     base.Reset();
     recticleAnimation   = GameObject.Find("Reticule").GetComponent <RecticleAnimation>();
     mobileDamageImage   = GameObject.Find("DamageImage").GetComponent <UIFader>();
     mobileGateHealthBar = GameObject.Find("HealthForegound").GetComponent <Image>();
     mobileHtcHealthBar  = GameObject.Find("HTCHealthBar").GetComponent <Image>();
 }
 private void Awake()
 {
     happyFace = GameObject.FindGameObjectWithTag("HappyFace");
     GameObject.Find("Store").GetComponent <websockets>();
     balloonTxt = gameObject.GetComponentInChildren <Text>();
     fader      = GameObject.FindGameObjectWithTag("Fader").GetComponent <UIFader>();
     gameObject.GetComponentInParent <CanvasGroup>().alpha = 0;
 }
Beispiel #11
0
 void Update()
 {
     FadeImage.color = UIFader.GetUIColor();
     if (UIFader.isFaded)
     {
         FadeImage.raycastTarget = false;
     }
 }
Beispiel #12
0
 private void AddFaderImageIfNeeded()
 {
     if (_fader == null)
     {
         gameObject.AddComponent <UIFader>();
         _fader = GetComponent <UIFader>();
     }
 }
 public void Deselect()
 {
     if (FlashlightGO.activeSelf && !isReloading)
     {
         StartCoroutine(UIFader.FadeOut(2));
         StartCoroutine(DeselectCorountine());
     }
 }
Beispiel #14
0
    // Start is called before the first frame update
    void Start()
    {
        //New game data
        levelData = new PlayerData(timeLimitSeconds);

        //UI Fader
        uiFader = gameObject.GetComponent <UIFader>();
    }
        private IEnumerator ShowMenu(UIFader fader, SelectionSlider slider)
        {
            yield return(StartCoroutine(fader.InteruptAndFadeIn()));

            yield return(StartCoroutine(slider.WaitForBarToFill()));

            yield return(StartCoroutine(fader.InteruptAndFadeOut()));
        }
Beispiel #16
0
 private void ShowError(string message)
 {
     error.text    = message;
     error.enabled = true;
     UIFader.CancelCurrent();
     UIFader.FadeIn(error, 0.1f);
     UIFader.FadeOut(error, 3.0f, 1.0f);
 }
    public override IEnumerator Run()
    {
        UIFader fader = CanvasManager.instance.Get <UIFader>(UIPanelID.Fader);

        yield return(fader.EndDay());

        ConversationManager.Instance.Variables["guests"] = GameManager.Instance._numGuests.ToString();
        ConversationManager.Instance.Variables["party"]  = (GameManager.Instance._numGuests >= 104 ? "success" : "fail");
    }
Beispiel #18
0
 // Use this for initialization
 void Start()
 {
     mainMenuParent    = GameObject.Find("MainMenuParent").GetComponent <UIFader> ();
     pauseMenuParent   = GameObject.Find("PauseMenuParent").GetComponent <UIFader> ();
     levelSelectParent = GameObject.Find("LevelSelectParent").GetComponent <UIFader> ();
     blackOverlay      = GameObject.Find("BlackOverlay").GetComponent <UIFader> ();
     logo = GameObject.Find("TitleLogo").GetComponent <UIFader> ();
     endgameMenuParent = GameObject.Find("EndgameMenuParent").GetComponent <UIFader> ();
 }
Beispiel #19
0
    void Start()
    {
        UIFader.SetColor(FadeImage.color);

        if (startFadeOut)
        {
            StartCoroutine(UIFader.FadeOut(FadeSpeed));
        }
    }
Beispiel #20
0
 /*Metodo para instanciar una clase en unity*/
 private void Awake()
 {
     atomManager = FindObjectOfType <AtomManager>();
     loadTPer    = FindObjectOfType <LoadTper>();
     UIFader     = FindObjectOfType <UIFader>();
     // seteo el CanvasGroup (tabla periodica) que voy a ocultar cuando llame al UIFader.FadeInAndOut
     // UIFader.uiElement = parent.transform.parent.gameObject.GetComponent<CanvasGroup>();
     BasicInfoLoader  = FindObjectOfType <BasicInfoLoader>();
     DetailInfoLoader = FindObjectOfType <DetailInfoLoader>();
 }
Beispiel #21
0
 //Find all of our resources
 void Reset()
 {
     reticule       = GameObject.Find("Crosshair").GetComponent <RawImage>();
     damageImage    = GameObject.Find("Damaged").GetComponent <UIFader>();
     gameStatusText = GameObject.Find("GameStatus").GetComponent <Text>();
     healthValue    = GameObject.Find("HealthValue").GetComponent <Text>();
     killsValue     = GameObject.Find("KillsValue").GetComponent <Text>();
     logText        = GameObject.Find("LogText").GetComponent <Text>();
     deathAudio     = GameObject.Find("DeathAudio").GetComponent <AudioSource>();
 }
Beispiel #22
0
 //Find all of our resources
 private void Reset()
 {
     _reticule       = GameObject.Find("Reticule").GetComponent <Image>();
     _damageImage    = GameObject.Find("DamagedFlash").GetComponent <UIFader>();
     _gameStatusText = GameObject.Find("GameStatusText").GetComponent <Text>();
     _healthValue    = GameObject.Find("HealthValue").GetComponent <Text>();
     _killsValue     = GameObject.Find("KillsValue").GetComponent <Text>();
     _logText        = GameObject.Find("LogText").GetComponent <Text>();
     _deathAudio     = GameObject.Find("DeathAudio").GetComponent <AudioSource>();
 }
 //Find all of our resources
 void Reset()
 {
     //Super slow code
     reticule       = GameObject.Find("Reticule").GetComponent <Image>();
     damageImage    = GameObject.Find("DamagedFlash").GetComponent <UIFader>();
     gameStatusText = GameObject.Find("GameStatusText").GetComponent <Text>();
     healthValue    = GameObject.Find("HealthValue").GetComponent <Text>();
     killsValue     = GameObject.Find("KillsValue").GetComponent <Text>();
     logText        = GameObject.Find("LogText").GetComponent <Text>();
     deathAudio     = GameObject.Find("DeathAudio").GetComponent <AudioSource>();
 }
Beispiel #24
0
    private void Construct(IRaceOverState _state)
    {
        m_state = _state;

        // Listen for state events
        m_fader = GetComponent <UIFader> ();
        m_fader.RegisterStateCallbacks((State)m_state);

        // turn off this gameobject in case it is active
        gameObject.SetActive(false);
    }
Beispiel #25
0
 private void Awake()
 {
     ws = GameObject.Find("Store").GetComponent <websockets>();
     hints.Add("ENDED", "Al momento il tuo assistente è in pausa. \nProva a richiamarlo dicendo: \"Computer avvia Shopper\"");
     hints.Add("STARTED", "Cosa puoi chiedermi: \n \"Aggiungi borsa al carrello\" \n \"Istruzioni\" \n \"Quanto costa jeans\" ");
     hints.Add("BOUGHT", "Cosa puoi chiedermi: \n \"Aggiungi borsa al carrello\" \n \"Istruzioni\" \n \"Quanto costa jeans\" ");
     hints.Add("CANBUY", "Cosa puoi chiedermi: \n \"Aggiungi borsa al carrello\" \n \"Istruzioni\" \n \"Quanto costa jeans\" \n \"Acquista\" ");
     gameObject.GetComponent <Text>().text = hints["ENDED"];
     fader = GameObject.FindGameObjectWithTag("Fader").GetComponent <UIFader>();
     gameObject.GetComponentInParent <CanvasGroup>().alpha = 0;
 }
    //Find all of our resources
    void Reset()
    {
        reticule    = GameObject.Find("Reticule").GetComponent <Image>();
        damageImage = GameObject.Find("DamagedFlash").GetComponent <UIFader>();

        allText = GameObject.Find("AllText").GetComponent <Text>();
        //gameStatusText = GameObject.Find("GameStatusText").GetComponent<Text>();
        // healthValue = GameObject.Find("HealthValue").GetComponent<Text>();
        //killsValue = GameObject.Find("KillsValue").GetComponent<Text>();
        //logText = GameObject.Find("LogText").GetComponent<Text>();
        deathAudio = GameObject.Find("DeathAudio").GetComponent <AudioSource>();
    }
 /// <summary>
 /// Creates and initializes shared UI objects.
 /// </summary>
 private void InitializeSharedUI()
 {
     if (m_uiFader == null)
     {
         m_uiFader = CreateSharedUIFromPrefab<UIFader>(UI_FADER_PREFAB_PATH);
         m_uiFader.transform.parent = this.transform;
     }
     if (!m_uiFader.IsInitialized)
     {
         m_uiFader.Initialize();
     }
 }
        private IEnumerator ShowMenu(UIFader fader, VRTrackerTag tag)
        {
            yield return(StartCoroutine(fader.InteruptAndFadeIn()));

            yield return(StartCoroutine(tag.WaitForAssignation()));

            if (tag.IDisAssigned)
            {
                transform.GetComponent <AudioSource> ().Play();
            }
            yield return(StartCoroutine(fader.InteruptAndFadeOut()));
        }
Beispiel #29
0
 private void Construct(IBuildEditorState _state,
                        [Inject(Id = "TrackParent")] ISplineManager _splineMgr,
                        [Inject(Id = "TrackParent")] StreetView _streetView,
                        DialogBuilder.Factory _dialogBuilderFactory)
 {
     m_state = _state;
     m_fader = GetComponent <UIFader> ();
     m_fader.RegisterStateCallbacks(( State )m_state);
     gameObject.SetActive(false);
     m_streetView           = _streetView;
     m_dialogBuilderFactory = _dialogBuilderFactory;
 }
        private IEnumerator ShowMenu(UIFader fader, VRTrackerAssociation prefab)
        {
            yield return(StartCoroutine(fader.InteruptAndFadeIn()));

            prefab.WaitForAssignation();
            yield return(StartCoroutine(VRTrackerTagAssociation.instance.WaitForAssignation()));

            if (prefab.isIDAssigned)
            {
                transform.GetComponent <AudioSource> ().Play();
            }
            yield return(StartCoroutine(fader.InteruptAndFadeOut()));
        }
Beispiel #31
0
    private void TryInitialize()
    {
        if (IsInitialized)
            return;

        IsInitialized = true;

        Fader = GetComponent<UIFader>();

        IsVisible = !VisibleOnStart;
        if(VisibleOnStart)
            Show();
        else
            Hide();
    }
 // Use this for initialization
 void Start()
 {
     uiFader = this.GetComponent<UIFader>();
     uiFader.Fade(0, 0, EasingFunctions.TYPE.Out);
 }
Beispiel #33
0
 void Start()
 {
     THUDImageFader = THUDImage.GetComponent<UIFader>();
     THUDTitleFader = THUDTitle.GetComponent<UIFader>();
     THUDDescriptionFader = THUDDescription.GetComponent<UIFader>();
 }
    /// <summary>
    /// Initialize private variables.
    /// </summary>
    void Awake()
	{
		m_puzzle = "";
		m_uiFader = GetComponent<UIFader>();
        src = GetComponent<AudioSource>();
	}