public override void RestartActiveTrainingSection()
    {
        TWTransition.ScreenTransition(TWTransition.TransitionType.DOWN_IN, .5f, () =>
        {
            DOTween.Complete("Shake");
            DOTween.Complete("TLEO_Missile");
            GameData.ActiveItem.wasUsed = false;
            SceneManager.LoadScene("TrainingRoom_Item");

            /*TWTransition.ScreenTransition(TWTransition.TransitionType.DOWN_OUT, .5f, () =>
             * {
             *  if (GameData.ActiveItem.ActivateOnStart)
             *  {
             *      GameData.ActiveItem.TakeEffect();
             *      TrainingUI.instance.UpdateItemImage();
             *  }
             *  GameData.ActiveItem.wasUsed = false;
             *  CharaData.hp = CharaData.maxhp;
             *  TrainingUI.instance.UpdateLive();
             *  TrainingUI.instance.UpdateItemImage();
             *  base.RestartActiveTrainingSection();
             *  StartDialog();
             * });*/
        });
    }
Beispiel #2
0
    public void OnAnnounceDone()
    {
        if (_item_trigger)
        {
            return;
        }

        if (_announcing)
        {
            DOTween.Complete("announce");
            _announcing = false;
        }
        else
        {
            if (_trigger)
            {
                if (_announce_type == 0)
                {
                    CloseAnnounce();
                }
                else if (_announce_type == 1)
                {
                    CloseAnnounceItem();
                }
                _trigger = false;
            }
        }
    }
Beispiel #3
0
    IEnumerator CO_TestDOCompleteBy(bool byTarget, bool tweenFloatValue)
    {
        Debug.Log(Time.realtimeSinceStartup + " :: Create " + totTweens + " tweens on " + (tweenFloatValue ? "float" : "transform"));
        for (int i = 0; i < totTweens; ++i)
        {
            Tween t = tweenFloatValue
                                ? DOTween.To(() => floatValue, x => floatValue = x, 2, 10)
                                : target.DOMoveX(2, 10);
            if (!byTarget)
            {
                t.SetId("myId");
            }
            else if (tweenFloatValue)
            {
                t.SetTarget(target);
            }
        }
        yield return(new WaitForSeconds(2f));

        Debug.Log(Time.realtimeSinceStartup + " :: Complete " + totTweens + " tweens by " + (byTarget ? "target" : "id"));
        float time = Time.realtimeSinceStartup;

        if (byTarget)
        {
            target.DOComplete();
        }
        else
        {
            DOTween.Complete("myId");
        }
        float elapsed = Time.realtimeSinceStartup - time;

        Debug.Log(Time.realtimeSinceStartup + " :: Completed " + totTweens + " tweens in " + elapsed + " seconds");
    }
Beispiel #4
0
    public async Task ToggleTint()
    {
        Debug.Log("Tint the screen");

        var blackScreen = transform.Find(BlackScreenSpriteName).GetComponent <Image>();

        // Complete any running tint job
        DOTween.Complete(blackScreen);

        if (blackScreen.color.a == 0.8f)
        {
            // Untint

            blackScreen.DOFade(0, 1f).SetTarget(blackScreen);
            await Task.Delay(1000);

            blackScreen.GetComponent <Canvas>().sortingOrder = 0;

            blackScreen.transform.SetAsFirstSibling();
        }
        else
        {
            // Tint

            blackScreen.color = new Color(blackScreen.color.r, blackScreen.color.g, blackScreen.color.b, 0f);

            blackScreen.GetComponent <Canvas>().sortingOrder = 999;

            // Wait a bit
            await Task.Delay(1000);

            blackScreen.DOFade(0.8f, 1f).SetTarget(blackScreen);
        }
    }
    public void shipTakeDamage(int i)
    {
        if (currentHealth > 0)
        {
            currentHealth -= i;
            //healthSlider.value = currentHealth;
            //Debug.Log(currentHealth/100);
            healthImage.DOFillAmount(((float)currentHealth) / 100, 0.5f);

            //Randomizing which facility gets damaged
            int randomFaci = Random.Range(0, facilityList.Count);
            int randomCrit = Random.Range(0, 2);
            if (randomCrit == 0)
            {
                facilityList[randomFaci].damageFacility(i);
            }

            if (currentHealth < 50)
            {
                cargoTakeDamage(10);                 // Takes 10 perm damage
            }
            //Debug.Log (healthImage.fillAmount);
            healthTxt.text = "Health: " + currentHealth;
            DOTween.Complete(innerCam.transform);
            innerCam.transform.DOShakePosition(0.5f, 5.0f, 30);
            Notifier.GetComponentInChildren <NotificationManager> ().NotifyText("Ship took " + i + " damage");
        }
    }
        public override void OnEnter()
        {
            int numberOfTweensCompleted = 0;

            switch (tweenIdType)
            {
            case DOTweenActionsEnums.TweenId.UseString: if (string.IsNullOrEmpty(stringAsId.Value) == false)
                {
                    numberOfTweensCompleted = DOTween.Complete(stringAsId.Value, withCallbacks.Value);
                }
                break;

            case DOTweenActionsEnums.TweenId.UseTag: if (string.IsNullOrEmpty(tagAsId.Value) == false)
                {
                    numberOfTweensCompleted = DOTween.Complete(tagAsId.Value, withCallbacks.Value);
                }
                break;

            case DOTweenActionsEnums.TweenId.UseGameObject: if (gameObjectAsId.Value != null)
                {
                    numberOfTweensCompleted = DOTween.Complete(gameObjectAsId.Value, withCallbacks.Value);
                }
                break;
            }

            if (debugThis.Value)
            {
                Debug.Log("GameObject [" + State.Fsm.GameObjectName + "] FSM [" + State.Fsm.Name + "]  State [" + State.Name + "] - DOTween Control Methods Complete By Id - SUCCESS! - Completed " + numberOfTweensCompleted + " tweens");
            }

            Finish();
        }
Beispiel #7
0
    IEnumerator CO_TestDOCompleteBy(bool byTarget, bool tweenFloatValue)
    {
        Debug.Log(string.Format("{0} :: Create {1} tweens on {2}", Time.realtimeSinceStartup, totTweens, (tweenFloatValue ? "float" : "transform")));
        for (int i = 0; i < totTweens; ++i)
        {
            Tween t = tweenFloatValue
                                ? DOTween.To(() => floatValue, x => floatValue = x, 2, 10)
                                : target.DOMoveX(2, 10);
            if (!byTarget)
            {
                t.SetId("myId");
            }
            else if (tweenFloatValue)
            {
                t.SetTarget(target);
            }
        }
        yield return(new WaitForSeconds(2f));

        Debug.Log(string.Format("{0} :: Complete {1} tweens by {2}", Time.realtimeSinceStartup, totTweens, (byTarget ? "target" : "id")));

        float time = Time.realtimeSinceStartup;

        if (byTarget)
        {
            target.DOComplete();
        }
        else
        {
            DOTween.Complete("myId");
        }
        float elapsed = Time.realtimeSinceStartup - time;

        Debug.Log(string.Format("{0} :: Completed {1} tweens in {2} [ms]", Time.realtimeSinceStartup, totTweens, elapsed * 1000.0f));
    }
        void OnGUI()
        {
            if (currentState != State.InputName)
            {
                return;
            }

            if (Event.current.type == EventType.KeyDown)
            {
                Event evt = Event.current;
                if (evt.keyCode == KeyCode.None || evt.keyCode == KeyCode.Backspace || evt.keyCode == KeyCode.Return)
                {
                    return;
                }

                if (NameInput.text.Length == NameInput.characterLimit)
                {
                    if (DOTween.IsTweening(errorId))
                    {
                        return;
                    }

                    DOTween.Complete(stateTransitionId, withCallbacks: true);
                    Error(NameInput.textComponent);
                    Error(CharLimitPrompt);
                }
            }
        }
Beispiel #9
0
        public override void OnEnter()
        {
            int numberOfTweensCompleted = 0;

            switch (tweenIdType)
            {
            case Doozy.PlayMaker.Actions.TweenId.UseString: if (string.IsNullOrEmpty(stringAsId.Value) == false)
                {
                    numberOfTweensCompleted = DOTween.Complete(stringAsId.Value, withCallbacks.Value);
                }
                break;

            case Doozy.PlayMaker.Actions.TweenId.UseTag: if (string.IsNullOrEmpty(tagAsId.Value) == false)
                {
                    numberOfTweensCompleted = DOTween.Complete(tagAsId.Value, withCallbacks.Value);
                }
                break;

            case Doozy.PlayMaker.Actions.TweenId.UseGameObject: if (gameObjectAsId.Value != null)
                {
                    numberOfTweensCompleted = DOTween.Complete(gameObjectAsId.Value, withCallbacks.Value);
                }
                break;
            }
            if (debugThis.Value)
            {
                State.Debug("DOTween Control Methods Complete By Id - Completed " + numberOfTweensCompleted + " tweens");
            }
            Finish();
        }
Beispiel #10
0
    public override void Reset()
    {
        base.Reset();
        if (state_Boss == null)
        {
            return;
        }
        gameEnd = false;

        StopAllCoroutines();
        state_Boss.SetEmptyAnimation(0, 0);
        var tarck = state_Boss.AddAnimation(0, enterTalking, false, 0);

        tarck.TimeScale = 0;

        bossElectricity.Power = 0;
        bossFireProjectile.Stop();
        missileLauncher.Reset();
        obj_WarningUI.SetActive(false);

        DOTween.Complete(spine_Boss.transform);
        spine_Boss.transform.position = bossStartPos;

        AudioController.StopCategory("Boss00");
        AudioController.SetCategoryVolume("Boss00", 1f);
        AudioController.SetCategoryVolume("Sfx", 1f);
        Time.timeScale = 1f;
    }
Beispiel #11
0
    void Flashing()
    {
        if (usingDangoWeight)
        {
            DOTween.Complete("DangoMain");
            dangoMain.DOFloat(0f, "_FlashAmount", 0f);

            DOTween.Sequence()
            .Append(dangoWeight.DOFloat(flashingValue, "_FlashAmount", flashTime))
            .Append(dangoWeight.DOFloat(0f, "_FlashAmount", flashTime))
            .SetLoops(flashCount)
            .SetId("DangoWeight");
        }
        else
        {
            DOTween.Complete("DangoWeight");
            dangoWeight.DOFloat(0f, "_FlashAmount", 0f);

            DOTween.Sequence()
            .Append(dangoMain.DOFloat(flashingValue, "_FlashAmount", flashTime))
            .Append(dangoMain.DOFloat(0f, "_FlashAmount", flashTime))
            .SetLoops(flashCount)
            .SetId("DangoWeight");
        }
    }
        void IEcsRunSystem.Run()
        {
            foreach (var i in _filter)
            {
                var view = _filter.Get1(i).Value;

                DOTween.Complete(view.transform);

                var destroyed = _filter.GetEntity(i).Has <Destroyed>();
                if (destroyed)
                {
                    var particleParams = new ParticleSystem.EmitParams
                    {
                        position             = view.transform.localPosition,
                        startColor           = view.Renderer.color,
                        applyShapeToPosition = true
                    };

                    _scene.DestroyParticles.Emit(particleParams, 10);
                }

                _filter.GetEntity(i).Del <UnityObject <BubbleView> >();
                Object.Destroy(view.gameObject);
            }
        }
    public override void Reset()
    {
        if (state_Boss == null)
        {
            return;
        }
        gameEnd = false;

        //LogManager.Log("Go = Restart");

        spine_Boss.gameObject.SetActive(true);
        spine_BossAttack.gameObject.SetActive(false);
        spine_BossDamage.gameObject.SetActive(false);
        spine_BossDie.gameObject.SetActive(false);

        state_Boss.SetEmptyAnimation(0, 0);
        var tarck = state_Boss.AddAnimation(0, enterTalk, false, 0);

        tarck.TimeScale = 0;

        obj_electricity.SetActive(false);
        bossFireProjectile.Stop();
        missileLauncher.Reset();

        DOTween.Complete(spine_Boss.transform);
        spine_Boss.transform.position = bossStartPos;
    }
Beispiel #14
0
 public void DisplayCombo(int combo)
 {
     DOTween.Complete(comboLabel);
     comboLabel.text  = "Combo X " + combo;
     comboLabel.color = Utilities.ChangeColorAlpha(comboLabel.color, 1);
     comboLabel.DOColor(Utilities.ChangeColorAlpha(comboLabel.color, 0), 1f);
 }
Beispiel #15
0
 /// <summary>
 /// This method should be overriden without calling the base-method.
 /// </summary>
 public virtual void OnActivate(bool instant = false)
 {
     DOPlayForward();
     if (instant)
     {
         DOTween.Complete(id, true);
     }
 }
Beispiel #16
0
    public void OnPointerClick(PointerEventData e)
    {
//        if (isPlayingEffect) return;
        DOTween.Complete(transform);
        transform.localScale = normalScale * minScale;
        CoReleaseAnimation();
        //ClientConfig.Sound.PlaySound(ClientConfig.Sound.SoundId.Button_Click);
    }
        private void OnHealthChanged(float current, float old)
        {
            RefreshHealth();

            DOTween.Complete(healthBar.transform);
            healthBar.transform.localScale = Vector3.one;
            healthBar.transform.DOPunchScale(new Vector3(0.2f, 0.2f), 0.3f);
        }
Beispiel #18
0
 public void SetColor(Color color, float duration = 0)
 {
     for (int i = 0; i < TileRenderers.Length; i++)
     {
         DOTween.Complete(InstanceId);
         TileRenderers[i].material.DOColor(color, duration).SetId(InstanceId);
     }
 }
        private void OnShieldChanged(float current, float old)
        {
            RefreshShield();

            DOTween.Complete(shieldBar.transform);
            shieldBar.transform.localScale = Vector3.one;
            shieldBar.transform.DOPunchScale(new Vector3(0.2f, 0.2f), 0.3f);
        }
    public void PunchScale(Transform trans, float scale, TweenCallback onComplete, float duration = 0.5f)
    {
        string id = gameObject.GetInstanceID() + "PunchScale";

        DOTween.Complete(id);
        Vector3 punchScale = new Vector3(scale, scale, scale);

        trans.DOPunchScale(punchScale, duration).SetId(id).OnComplete(onComplete);
    }
        /// <summary>
        /// Slightly fades the vitals when the health and shield is at max value. Fade to solid when either health or shield is missing.
        /// </summary>
        private void HandleFading()
        {
            DOTween.Complete(cachedCanvasGroup);

            // Whether the health or shield is below max value.
            bool isBelowMaxValue = healthComponent.CurrentValue < healthComponent.MaxValue || shieldComponent.CurrentValue < shieldComponent.MaxValue;

            cachedCanvasGroup.DOFade(isBelowMaxValue ? 1.0f : 0.3f, 0.3f);
        }
 public void Shake(float duration, float strength, int vibrato)
 {
     this.duration = duration;
     this.strength = strength;
     this.vibrato  = vibrato;
     DOTween.Complete("Shake");
     main.DOShakeRotation(this.duration, this.strength, this.vibrato).SetId("Shake");
     //main.DOShakeRotation(this.duration, Vector3.zero, this.vibrato);
 }
Beispiel #23
0
    public void OnSkip()
    {
        if (!_trigger)
        {
            return;
        }

        DOTween.Complete("end");
    }
Beispiel #24
0
    /// <summary>
    /// Move relative to the current position
    /// </summary>
    /// <param name="position">How much to move relative to the current position</param>
    /// <param name="time">The time it takes for the movement to complete</param>
    public void SetPosition(Vector3 position, float time)
    {
        // Complete any running DOLocalMove
        DOTween.Complete(transform);

        transform.DOLocalMove(new Vector3(
                                  transform.localPosition.x + position.x,
                                  transform.localPosition.y + position.y,
                                  0
                                  ), time).SetTarget(transform);
    }
Beispiel #25
0
 public void OnTalkDone()
 {
     if (_talking)
     {
         DOTween.Complete("talk");
         _talking = false;
     }
     else
     {
         CloseTalk();
         GameData.Instance._event.OnNextEvent();
     }
 }
Beispiel #26
0
        private void OnSpaceCreditsCounterChanged(int newValue)
        {
            if (label == null)
            {
                return;
            }

            label.text = newValue.ToString();

            DOTween.Complete(label.transform);
            label.transform.localScale = Vector3.one;
            label.transform.DOPunchScale(new Vector3(0.3f, 0.3f, 0.0f), 0.3f);
        }
Beispiel #27
0
    private void FinishAnimation()
    {
        if (_animationCoroutine != null)
        {
            if (DOTween.IsTweening(_animationId))
            {
                DOTween.Complete(_animationId);
            }

            StopCoroutine(_animationCoroutine);
            _animationCoroutine = null;
        }
    }
Beispiel #28
0
    /// <summary>
    /// Move from to a predetermined position in the SpeakerSystem.Positions list
    /// </summary>
    /// <param name="positionName">The position to move to</param>
    /// <param name="time">The time it takes to move to the specified position</param>
    public void SetPosition(string positionName, float time)
    {
        if (SpeakerSystem.Positions.ContainsKey(positionName))
        {
            // Complete any running DOLocalMove
            DOTween.Complete(transform);

            transform.DOLocalMove(SpeakerSystem.Positions[positionName], time).SetTarget(transform);
        }
        else
        {
            Debug.LogError($"Could not set the position with the name {positionName}");
        }
    }
Beispiel #29
0
    public void SaySomething(string command)
    {
        DOTween.Complete(gameObject.GetInstanceID());
        activeSay = true;

        text.text = GetRandomSay(dialogues.First(e => e.command == command));

        DOTween.Sequence()
        .AppendCallback(() => AdjustPos())
        .Append(text.DOFade(1f, 0))
        .AppendInterval(1f)
        .Append(text.DOFade(0f, 1f))
        .OnComplete(() => activeSay = false).SetId(gameObject.GetInstanceID());
    }
 public IEnumerator SelectInvestigator(InvestigatorComponent investigator)
 {
     if (investigator != GameControl.CurrentInvestigator)
     {
         DOTween.Kill("SelectInvestigator");
         DOTween.Complete("StackOrder");
         if (GameControl.CurrentInvestigator != null)
         {
             yield return(RemoveCardsInTable());
         }
         GameControl.CurrentInvestigator = investigator;
         yield return(MoveCardsToTable(investigator));
     }
 }