Echo
Here we have some examples on how to build Echoes
Basic
- Creating the echo
- Setting the timeout to 100 seconds
- Setting the stop condition based on a local flag
- Setting a delay of 4 seconds
- Adding an event that is executed before the start of the echo
- Adding an event that is executed after the completion of the echo
- Starting the echo
Echo echo = new Echo()
.SetTimeout(100f)
.SetStopCondition((time) => echoShouldStopFlag)
.SetDelay(4f)
.OnStarting(() => Debug.Log("Before start."))
.OnCompleted(() => Debug.Log("After completion!"))
.Start();
Simple Motion
- Creating the echo with a timeout of 10s
- Selecting the object to be animated
- Applying the MoveTowards motion
- Starting the echo
Echo echo = new Echo(10f)
.For(transform)
.MoveTowards(otherTransform)
.Start();
Character Control
This is an example of the many functionalities that can be achieved with echoes. This is controlling the character using simple input.
- Creating the echo for the CharacterController
- Applying the Move motion
- Applying the Rotate motion
- Starting the echo
Echo echo = CharacterController
.Echo()
.Move(10f)
.Rotate(Camera.transform, 5f)
.Start();