Comments (2)
Just a note, if folks need something like this you can create some helper static methods in a static class, like this:
public static class GlobalHelpers
{
private static Tween FogStartDistanceTween;
private static Tween FogEndDistanceTween;
private static Tween AmbientColorTween;
// method to change fog settings
public static void TweenFogDistances(float start, float end, float time, Action completeLambda = null)
{
FogStartDistanceTween.Kill();
FogEndDistanceTween.Kill();
FogStartDistanceTween = DOTween.To(() => RenderSettings.fogStartDistance, (x) => RenderSettings.fogStartDistance = x, start, time);
FogEndDistanceTween = DOTween.To(() => RenderSettings.fogEndDistance, (x) => RenderSettings.fogEndDistance = x, end, time);
FogStartDistanceTween.OnComplete(() => completeLambda?.Invoke());
}
// method to change ambient color
public static Tween TweenAmbientColor(Color color, float time)
{
AmbientColorTween.Kill();
AmbientColorTween = DOTween.To(() => RenderSettings.ambientLight, (x) => RenderSettings.ambientLight = x, color, time);
return AmbientColorTween;
}
}
from dotween.
I like it! Added to my todo list
from dotween.
Related Issues (20)
- Managing Dynamic WayPoint Updates in DOPath
- How DOTween.ManualUpdate works?
- Build for Android failed - Error: IL2CPP error for type 'DG.Tweening.Tween' in assembly
- OnComplete problem (again of course) with singleton classes
- How to make OnUpdate and ChangeEndValue work properly?
- Index out of range error
- Startup errors not giving detailed warnings when default logging enabled
- DOComplete -> TweenManager.FilteredOperation: IndexOutOfRangeException (Possibly related to SetTweensCapacity?)
- [Feature Request] Assembly Definition & Version Define Resource HOT 1
- The DOTweenPath won't rotate or move with the parent
- WaitForCompletion stuck on recycled tween
- Can Dojump use endvalues ββthat change in real time?
- DoPath - Change waypoints during tween is running
- Combining Eases HOT 1
- UI Tweening works unreliably HOT 7
- NaN Input Error HOT 2
- Upgrading to Unity 6 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
- SetDelay is appending interval between two tween Joined in sequence HOT 2
- DOTween adds 2.7MB to WebGL build HOT 1
- Is DOJump not supported for Kinematic 3D Rigidbodies?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotween.