コード例 #1
0
    public void FadeOut(float time)
    {
        Color transparent = Color.white;

        transparent.a = 0f;
        Tween.Color(target, transparent, time, 0);
    }
コード例 #2
0
 void OnEnable()
 {
     Rigidbody2D.isKinematic = true;
     Root.gameObject.layer   = LeverAvoidingLayer;
     Tween.LocalScale(Root, Vector3.one, Vector3.zero, ScaleTime, 0, Tween.EaseIn, Tween.LoopType.None, null, HandleTweenFinished);
     Tween.Color(RendererTarget, new Color(1, 1, 1, 1), new Color(1, 1, 1, 0), ScaleTime, 0f, Tween.EaseIn, Tween.LoopType.None);
 }
コード例 #3
0
 public override void Act()
 {
     foreach (var renderer in Renderers)
     {
         Tween.Color(renderer, renderer.material.color, HighlightedColor, AnimationTime, 0f, AnimationCurve, Tween.LoopType.None);
     }
 }
コード例 #4
0
 void OnEnable()
 {
     foreach (var renderer in Renderers)
     {
         Tween.Color(renderer, renderer.material.color, HighlightedColor, AnimationTime, 0f, AnimationCurve, Tween.LoopType.None);
     }
 }
コード例 #5
0
ファイル: Player.cs プロジェクト: donnieholstrom/Around
    public void DamageEffect(int damage)
    {
        cameraShake.Shake(0.25f * damage);

        Tween.Color(playerRenderer, damageColor, 0.07f, 0f, Tween.EaseIn);
        Tween.Color(playerRenderer, startColor, 0.07f, 0.07f, Tween.EaseOut);
    }
コード例 #6
0
ファイル: Checkpoint.cs プロジェクト: macadamc/Afterlife
    protected override void OnInteractButtonPress()
    {
        if (runner == null)
        {
            runner = dialouge.GetComponent <DialogueRunner>();
        }

        if (runner == null || runner.isDialogueRunning || PauseManager.Instance.Paused)
        {
            return;
        }

        base.OnInteractButtonPress();
        GlobalStorage.Instance.storage.SetValue("checkpoint_id", Id);
        GlobalStorage.Instance.storage.SetValue("checkpoint_scene", m_currentSceneName);

        var hp = Player.Instance.gameObject.GetComponent <PlayerHealth>();

        hp.currentHealth.Value = hp.maxHealth.Value;

        if (activated == false)
        {
            CheckPointManager.Instance.checkPoints.Add(Id);
            Tween.Color(waypointLight, waypointLight.color, lightColor, .2f, 0.2f, Tween.EaseInOut, Tween.LoopType.None, null, null, true);
            particles.SetActive(true);
            dialouge.SetActive(true);
            activated = true;
        }
        else
        {
            StartCoroutine(TeleportToPrompt());
        }

        PersistentDataManager.SaveExternal();
    }
コード例 #7
0
 public void GoToNextLevel()
 {
     //levelNameText.CrossFadeAlpha(0f, 0.2f, false);
     levelNameText.CrossFadeColor(Color.clear, 0.2f, false, true);
     Tween.Color(fadeImage, Color.black, 0.2f, 0f, Tween.EaseInOutStrong, Tween.LoopType.None, null,
                 () => { SwitchToLevel(CurrentLevelIndex + 1); });
 }
コード例 #8
0
 void OnEnable()
 {
     foreach (var image in Images)
     {
         Tween.Color(image, image.color, DesiredColor, AnimationTime, 0f, AnimationCurve, Tween.LoopType.None);
     }
 }
コード例 #9
0
    void StartPulsingText()
    {
        Vector3 textStartSize = new Vector3(1.0f, 1.0f, 1.0f);
        Vector3 textEndSize   = new Vector3(1.1f, 1.1f, 1.0f);

        Tween.Color(touchToStart, textEndColour, 0.5f, 0, Tween.EaseOut);
        Tween.LocalScale(touchToStart.transform, textStartSize, textEndSize, 0.5f, 0, Tween.EaseInOut, Tween.LoopType.PingPong);
    }
コード例 #10
0
 void OnConsume()
 {
     if (canStart)
     {
         canStart = false;
         Tween.Color(fadeImage, Color.black, 1f, 0f, Tween.EaseLinear, Tween.LoopType.None, null,
                     () => { SceneManager.LoadScene(gameSceneIndex); });
     }
 }
コード例 #11
0
    private void PulseText()
    {
        Vector3 startScale = new Vector3(1.0f, 1.0f, 1.0f);
        Vector3 endScale   = new Vector3(1.1f, 1.1f, 1.1f);

        Tween.Cancel(progressText.GetInstanceID());
        Tween.LocalScale(progressText.transform, startScale, endScale, 0.75f, 0, pulseCurve, Tween.LoopType.None);
        Tween.Color(progressText, Color.black, Color.red, 0.75f, 0f, pulseCurve, Tween.LoopType.None);
    }
コード例 #12
0
    void OnCollisionEnter(Collision collision)
    {
        Tween.Shake(_shakeTarget, _shakeTargetInitialPosition, Vector3.one * _shakeIntensity, _injuryDuration, 0);

        for (int i = 0; i < _renderers.Length; i++)
        {
            Tween.Color(_renderers[i], _injuryColor, _initialColors [i], _injuryDuration, 0);
        }
    }
コード例 #13
0
ファイル: Coin.cs プロジェクト: donnieholstrom/Around
    private void Awake()
    {
        spriteRenderer = GetComponent <SpriteRenderer>();

        gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();

        Tween.LocalScale(transform, new Vector3(2f, 2f, 2f), Vector3.one, 0.5f, 0f, Tween.EaseIn);
        Tween.Color(spriteRenderer, Color.clear, Color.yellow, 0.5f, 0f, Tween.EaseIn);

        StartCoroutine(JustSpawned());
    }
コード例 #14
0
 void Start()
 {
     Instance = this;
     ResetUndoInstructions();
     LoadLevel(InitialLevel);
     fadeImage.color = Color.black;
     Tween.Color(fadeImage, Color.clear, 0.5f, 0.5f, Tween.EaseInOutStrong);
     TextColor          = levelNameText.color;
     levelNameText.text = FullLevelName(InitialLevel);
     //levelNameText.alpha = 0;
     levelNameText.CrossFadeColor(Color.clear, 0f, false, true);
     levelNameText.CrossFadeColor(TextColor, 1.2f, false, true);
 }
コード例 #15
0
    public void Swallow(Transform hole)
    {
        Rigidbody2D.isKinematic = true;
        gameObject.layer        = LeverAvoidingLayer;
        foreach (var childTransform in GetComponentsInChildren <Transform>(true))
        {
            childTransform.gameObject.layer = LeverAvoidingLayer;
        }

        Tween.Position(transform, hole.position, ScaleTime, 0, Tween.EaseIn, Tween.LoopType.None);
        Tween.LocalScale(transform, Vector3.one, Vector3.zero, ScaleTime, 0, Tween.EaseIn, Tween.LoopType.None, null, HandleTweenFinished);
        Tween.Color(RendererTarget, new Color(1, 1, 1, 1), new Color(1, 1, 1, 0), ScaleTime, 0f, Tween.EaseIn, Tween.LoopType.None);
    }
コード例 #16
0
    private void Awake()
    {
        delay += 0.5f;
        Tween.Color(foundaryLogo, logoEndColour, 1.5f, delay, Tween.EaseBounce);

        delay += 1.0f;

        Vector3 frenzyStartSize = new Vector3(2.0f, 2.0f, 1.0f);
        Vector3 frenzyEndSize   = new Vector3(1.0f, 1.0f, 1.0f);

        Tween.Color(frenzy, frenzyEndColour, 1.0f, delay, Tween.EaseInStrong);
        Tween.LocalScale(frenzy.transform, frenzyStartSize, frenzyEndSize, 1.0f, delay, Tween.EaseInStrong, Tween.LoopType.None, null, StartPulsingText);
    }
コード例 #17
0
ファイル: ColliderButton.cs プロジェクト: Atom-101/Bad_Trip
 private void ColorPressed()
 {
     if (!applyColor)
     {
         return;
     }
     if (colorRendererTarget != null)
     {
         _colorTween = Tween.Color(colorRendererTarget, pressedColor, colorDuration, 0, null, Tween.LoopType.None, null, null, false);
     }
     if (colorImageTarget != null)
     {
         _colorTween = Tween.Color(colorImageTarget, pressedColor, colorDuration, 0, null, Tween.LoopType.None, null, null, false);
     }
 }
コード例 #18
0
 private void ColorPressed()
 {
     if (!applyColor)
     {
         return;
     }
     if (colorRendererTarget != null)
     {
         Tween.Color(colorRendererTarget, pressedColor, colorDuration, 0);
     }
     if (colorImageTarget != null)
     {
         Tween.Color(colorImageTarget, pressedColor, colorDuration, 0);
     }
 }
コード例 #19
0
 private void ColorNormal()
 {
     if (!applyColor)
     {
         return;
     }
     if (colorRendererTarget != null)
     {
         Tween.Color(colorRendererTarget, normalColor, colorDuration, 0);
     }
     if (colorImageTarget != null)
     {
         Tween.Color(colorImageTarget, normalColor, colorDuration, 0);
     }
 }
コード例 #20
0
 public void SwitchToLevel(int levelIndex)
 {
     Tween.Color(fadeImage, Color.clear, 0.5f, 0.5f, Tween.EaseInOutStrong);
     levelNameText.text = FullLevelName(levelIndex);
     levelNameText.CrossFadeColor(TextColor, 1.2f, false, true);
     //levelNameText.CrossFadeAlpha(80, 2f, false);
     // Do other things like animations.
     UnloadCurrentLevel();
     if (levelIndex < Levels.Count)
     {
         LoadLevel(levelIndex);
     }
     else
     {
         SceneManager.LoadScene(FinishedSceneIndex);
     }
 }
コード例 #21
0
 private void ColorSelected()
 {
     if (!applyColor)
     {
         return;
     }
     if (colorRendererTarget != null)
     {
         if (colorRendererTarget.material.HasProperty("_Color"))
         {
             _colorTween = Tween.Color(colorRendererTarget, selectedColor, colorDuration, 0, null, Tween.LoopType.None, null, null, false);
         }
     }
     if (colorImageTarget != null)
     {
         _colorTween = Tween.Color(colorImageTarget, selectedColor, colorDuration, 0, null, Tween.LoopType.None, null, null, false);
     }
 }
コード例 #22
0
ファイル: Spike.cs プロジェクト: donnieholstrom/Around
    private void Awake()
    {
        rb             = GetComponent <Rigidbody2D>();
        spriteRenderer = GetComponent <SpriteRenderer>();
        source         = GetComponent <AudioSource>();

        initialForce = new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f));

        Tween.LocalScale(transform, new Vector3(2f, 2f, 2f), Vector3.one, 0.5f, 0f, Tween.EaseIn);
        Tween.Color(spriteRenderer, Color.clear, darkRed, 0.5f, 0f, Tween.EaseIn);

        Tween.Color(spriteRenderer, darkRed, Color.red, 0.25f, 1f);

        cameraShake = Camera.main.GetComponent <CameraShake>();
        gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();

        StartCoroutine(JustSpawned());
    }
コード例 #23
0
        private void ColorDisabled()
        {
            if (!applyColor)
            {
                return;
            }

            //tween material color:
            if (colorRendererTarget != null && colorRendererTarget.material.HasProperty("_Color"))
            {
                _colorTweenMaterial = Tween.Color(colorRendererTarget, disabledColor, colorDuration, 0, null, Tween.LoopType.None, null, null, false);
            }

            //tween image color:
            if (colorImageTarget != null)
            {
                Tween.Color(colorImageTarget, disabledColor, colorDuration, 0, null, Tween.LoopType.None, null, null, false);
            }
        }
コード例 #24
0
ファイル: Fadeable.cs プロジェクト: lucashaley/Kyoto_01
        void FadeIn()
        {
            //go through each child renderer, and start the tween
            foreach (Renderer rend in childrenRenderers)
            {
                // then go through each material, as there may be more than one
                for (int i = 0; i < rend.materials.Length; i++)
                {
                    // check what kind of material it is
                    // we need to do different things to outlines and fills
                    switch (rend.materials[i].shader.name)
                    {
                    case string s when s.Contains("Standard"):
                        Color tempColor = rend.materials[i].GetColor("_Color");

                        tempColor.a = 1f;
                        Tween.Color(rend.materials[i], tempColor, gameController.stateChangeTime, 0f, null, Tween.LoopType.None, null, FlipRendermodeAll);
                        // switch to fade render mode
                        // we can't do this here, as it cuts off the fade
                        // so we put it all in a callback
                        // it's extra cycles, but hey
                        // FlipRendermode(rend.materials[i]);
                        break;

                    case string s when s.Contains("Outline Fill"):
                        Tween.ShaderFloat(rend.materials[i], "_OutlineWidth", 0f, gameController.stateChangeTime, 0f);

                        break;

                    case string s when s.Contains("Universal"):
                        Debug.LogError("URP Material!", rend.materials[i]);

                        break;
                    }
                }
            }

            // fade in global shadows
            Tween.Value(gameController.shadowDistanceFaded, gameController.shadowDistance, HandleShadowFade, gameController.shadowFadeTime, gameController.stateChangeTime);
        }
コード例 #25
0
ファイル: Fadeable.cs プロジェクト: lucashaley/Kyoto_01
        void FadeOut()
        {
            // fade out global shadows
            Tween.Value(gameController.shadowDistance, gameController.shadowDistanceFaded, HandleShadowFade, gameController.shadowFadeTime, 0f);

            // go through each child renderer, and start the tween
            foreach (Renderer rend in childrenRenderers)
            {
                // then go through each material, as there may be more than one
                for (int i = 0; i < rend.materials.Length; i++)
                {
                    // check what kind of material it is
                    // we need to do different things to outlines and fills
                    switch (rend.materials[i].shader.name)
                    {
                    case string s when s.Contains("Standard"):
                        // switch to fade render mode
                        // we can do this here, as we loop, to save cycles
                        FlipRendermode(rend.materials[i]);

                        Color tempColor = rend.materials[i].GetColor("_Color");
                        tempColor.a = gameController.fadeableFadeAmount;
                        Tween.Color(rend.materials[i], tempColor, gameController.stateChangeTime, gameController.shadowFadeTime);
                        break;

                    case string s when s.Contains("Outline Fill"):
                        Tween.ShaderFloat(rend.materials[i], "_OutlineWidth", gameController.fadeableOutlineWidth, gameController.stateChangeTime, gameController.shadowFadeTime);

                        break;

                    case string s when s.Contains("Universal"):
                        Debug.LogError("URP Material!", rend.materials[i]);

                        break;
                    }
                }
            }
        }
コード例 #26
0
 // Start is called before the first frame update
 void Start()
 {
     fadeImage.color = Color.black;
     Tween.Color(fadeImage, Color.clear, 1f, 0f, Tween.EaseLinear, Tween.LoopType.None, null, () => { canStart = true; });
 }
コード例 #27
0
 private void ChangeColorOverTime(Color color) => Tween.Color(panel, color, logoDuration * 0.5f, 0);
コード例 #28
0
 public void FadeIn(float time)
 {
     Tween.Color(target, Color.white, time, 0);
 }