Esempio n. 1
0
    private GameUi ModifyTime(int time)
    {
        int timeLeft = this.timer.GetTimeLeft();

        this.timer.SetTimeLeft(timeLeft + time);
        TweenEaseAnimationScaleComponent.CreateSequence("timer", new GameObject[] { this.timer.gameObject });

        return(this);
    }
Esempio n. 2
0
    public IPromise Show()
    {
        this.playAgain.gameObject.SetActive(true);
        this.info.gameObject.SetActive(true);
        this.title.gameObject.SetActive(true);
        this.background.GetComponent <Image>().enabled = true;

        this.playAgain.interactable = false;

        TweenEaseAnimationScaleComponent.CreateSequence("Win", new GameObject[] { this.playAgain.gameObject, this.info, this.title }, () => this.playAgain.interactable = true);

        return(new Promise((resolve, rejection) =>
        {
            UnityAction resolvePromise = null;
            resolvePromise = () => {
                SoundData playRestart = new SoundData(GetInstanceID(), SRResources.Audio.Effects.Confirm);
                Messenger.Publish(new PlayEffectMessage(playRestart));
                this.playAgain.onClick.RemoveListener(resolvePromise);
                resolve();
            };
            this.playAgain.onClick.AddListener(resolvePromise);
        }));
    }
Esempio n. 3
0
    public IPromise Show(int timeValue, int healthValue, int scoreValue)
    {
        ResetValues();
        this.background.GetComponent <Image>().enabled = true;
        this.continueButton.gameObject.SetActive(true);
        this.time.SetActive(true);
        this.health.SetActive(true);
        this.score.SetActive(true);

        this.continueButton.interactable = false;

        TweenEaseAnimationScaleComponent.CreateSequence("WinWorld", new GameObject[] { this.continueButton.gameObject, this.background }, () => this.continueButton.interactable = true);

        return(Promise.All(new Promise((resolve, rejected) =>
        {
            StartCoroutine(ScoreUpAnimation(this.time.GetComponent <Text>(), timeValue, () => resolve()));;
        }), new Promise((resolve, rejected) =>
        {
            StartCoroutine(ScoreUpAnimation(this.health.GetComponent <Text>(), healthValue, () => resolve()));
        }), new Promise((resolve, rejected) =>
        {
            StartCoroutine(ScoreUpAnimation(this.score.GetComponent <Text>(), scoreValue, () => resolve()));
        }), new Promise((resolve, reject) =>
        {
            UnityAction onClick = null;
            onClick = () =>
            {
                SoundData playRestart = new SoundData(GetInstanceID(), SRResources.Audio.Effects.Confirm);
                Messenger.Publish(new PlayEffectMessage(playRestart));
                this.continueButton.onClick.RemoveListener(onClick);
                resolve();
            };
            this.continueButton.onClick.AddListener(onClick);
        })
                           ));
    }
Esempio n. 4
0
 private GameUi animateHearts(GameObject[] copyHearts, float animationDelay = 0)
 {
     TweenEaseAnimationScaleComponent.CreateSequence("hearts", copyHearts, null, 0.5f, animationDelay);
     return(this);
 }