All Projects → beinteractive → Urmotion

beinteractive / Urmotion

Flexible motion engine for non time-based animation in Unity.

Projects that are alternatives of or similar to Urmotion

Uween
Lightweight tween library for Unity.
Stars: ✭ 123 (-44.09%)
Mutual labels:  unity, unity3d, tween
Nice Lua
基于xlua的MVVM框架,支持Addressables, 统一渲染管线等Unity新特性
Stars: ✭ 207 (-5.91%)
Mutual labels:  unity, unity3d
Mathutilities
A collection of some of the neat math and physics tricks that I've collected over the last few years.
Stars: ✭ 2,815 (+1179.55%)
Mutual labels:  unity, unity3d
Klakhap
HAP video player plugin for Unity
Stars: ✭ 209 (-5%)
Mutual labels:  unity, unity3d
Minis
Minis: MIDI Input for New Input System -- A plugin that adds MIDI input support to Unity's new Input System
Stars: ✭ 214 (-2.73%)
Mutual labels:  unity, unity3d
Delight
Delight is an open source component-oriented framework for Unity.
Stars: ✭ 201 (-8.64%)
Mutual labels:  unity, unity3d
Nativecollections
Native Collection Types for Unity
Stars: ✭ 213 (-3.18%)
Mutual labels:  unity, unity3d
Unity Shaders
✨ Shader demo - More than 300 examples
Stars: ✭ 198 (-10%)
Mutual labels:  unity, unity3d
Wfcmaze
WFC (Wave Function Collapse) with Unity
Stars: ✭ 212 (-3.64%)
Mutual labels:  unity, unity3d
Casinosclient
果派德州客户端源代码,使用Unity3D引擎。
Stars: ✭ 217 (-1.36%)
Mutual labels:  unity, unity3d
Noteeditor
Note editor for rhythm games.
Stars: ✭ 216 (-1.82%)
Mutual labels:  unity, unity3d
Noiseball2
A small example of procedural modeling with compute shaders.
Stars: ✭ 215 (-2.27%)
Mutual labels:  unity, unity3d
Contactshadows
Experimental implementation of contact shadows for Unity.
Stars: ✭ 219 (-0.45%)
Mutual labels:  unity, unity3d
Shinyeffectforugui
Shiny effect of uGUI, which does not need mask or normal map.
Stars: ✭ 204 (-7.27%)
Mutual labels:  unity, unity3d
Lomenui
Stylish UI package for Unity engine.
Stars: ✭ 199 (-9.55%)
Mutual labels:  unity, unity3d
Vfxgraphtestbed
My testbed for Unity VFX Graph
Stars: ✭ 209 (-5%)
Mutual labels:  unity, unity3d
Xrtk Core
The Official Mixed Reality Framework for Unity
Stars: ✭ 219 (-0.45%)
Mutual labels:  unity, unity3d
Asynccapturetest
Non-blocking screen capture example with asynchronous GPU readback
Stars: ✭ 191 (-13.18%)
Mutual labels:  unity, unity3d
Fluent State Machine
Fluent API for creating state machines in C#
Stars: ✭ 195 (-11.36%)
Mutual labels:  unity, unity3d
Egocs
EgoCS: An Entity (GameObject) Component System framework for Unity3D
Stars: ✭ 211 (-4.09%)
Mutual labels:  unity, unity3d

A flexible motion engine for non time-based animation in Unity

UrMotion (Your motion) is a brand new simple & flexible motion engine for Unity. It enables you to create non time-based complex animations on your script easy and fast.

To start using UrMotion, copy Assets/UrMotion directoy to your project and write using UrMotion; in your code.

using UnityEngine;
using System.Collections;
using UrMotion;

Examples

Simply uniform move

g.MotionX().Velocity(3f);

velocity_x

Simply uniform move (Moving Y)

g.MotionY().Velocity(3f);

velocity_y

Simply uniform move (Moving X & Y)

g.MotionP().Velocity(new Vector2(3f, 2f));

velocity_xy

Accel move

g.MotionX().Accel(0.3f);

accel_x

Accel move with initial speed

g.MotionX().Velocity(1f).Accel(0.3f);

accel_x_with_init

g.MotionX().Velocity(-6f).Accel(0.3f);

accel_with_init_2

Accel by ratio

g.MotionX().AccelByRatio(10f, 0.9f);

accel_by_ratio

Sin move

g.MotionX().Sin(83f, 0.5f);

sin

Circular move

g.MotionP().Circular(83f, 0.5f);

circular

Lissajous move

g.MotionP().Lissajous(83f, 51f, 0.6f, 1.2f, 0f);

lissajous

Aiming with uniform move

An aiming method produce a velocity that makes a GameObject go toward the specified position.

g.MotionP().AimAt(p, 10f);

aim

Aiming with common ratio

g.MotionP().AimRatioAt(p, 0.15f);

aim_ratio

Aiming with spring move

g.MotionP().AimSpringAt(p, 0.15f, 0.8f);

aim_spring

Aiming with exponential interpolation

g.MotionP().AimExpoAt(p, 0.15f);

aim_expo

Aiming with critically damped spring smoothing

g.MotionP().AimCriticalDampingAt(p, 0.15f);

aim_critical

Perlin noise

g.MotionP().Perlin(new Vector2(0.4f, 0.8f)).AmplifyComponents(new Vector2(3f, 2f));

perlin

Fractional brownian motion

g.MotionP().Fbm(new Vector2(0.4f, 0.8f), 3).AmplifyComponents(new Vector2(3f, 2f));

fbm

Timed parameter

Change velocity by time with sin curve.

g.MotionX().Velocity(Source.Float.Sin(2f, 1f).Offset(2f));

velocity_sin

Change radius by time with sin curve.

g.MotionX().Sin(Source.Float.Sin(51f, 0.5f).Offset(51f), 1f);

radius_sin

Custom parameter

You can use any of the following types as a motion parameter.

  • V
  • IEnumerator<V>
  • IEnumerable<V>
  • Func<V>

V is: float, Vector2, Vector3 or Vector4

g.MotionX().Velocity(() => Random.Range(-10f, 10f));

own_function

Lifetime control

Finish velocity effect after 15fr.

g.MotionX().Accel(0.3f).Lifetime(15f);

lifetime

Start velocity effect after 15fr.

g.MotionX().Accel(0.3f).StartDelay(15f);

delay

Finish velocity effect if it magnitude is less than 0.01f. Then, destroy a GameObject.

g.MotionX().AccelByRatio(10f, 0.9f).LiveThreshold(0.01f).Next(() => Destroy(g));

complete_velocity

Complex motion examples

Parabola

g.MotionX().Velocity(6f);
g.MotionY().Velocity(18f).Accel(-0.98f);

parabola

Spiral

g.MotionP().Circular(Source.Float.Sin(51f, 0.5f).Offset(51f), 2f);

spiral

Lissajous + Lissajous

g.MotionP().Lissajous(83f, 51f, 0.6f, 1.2f, 0f).Lissajous(24f, 32f, 2.4f, 0.8f, 0f);

lissajous lissajous

Lissajous with directon

var vel = default(IEnumerator<Vector2>);
g.MotionP().Lissajous(83f, 51f, 0.6f, 1.2f, 0f).Capture(out vel);
g.MotionR().AimRatioAt(vel.ToAngle().Offset(-90f), 1f);

lissajous direction

Floating scaling

g.MotionS().AccelByRatio(Vector2.one * 0.4f, 0.85f).Sin(Vector2.one * 0.5f, 0.5f);

floating_scaling

Aiming + Ciruclular move

var vel = default(IEnumerator<Vector2>);
var m = g.MotionP();
m.AimSpringAt(p, 0.1f, 0.45f).Capture(out vel);
m.Circular(vel.Magnitude().Amplify(2f), 2f);

aim circular

Scaling by velocity

var vel = default(IEnumerator<Vector2>);
g.MotionP().AimExpoAt(p, 0.15f).Capture(out vel);
g.MotionS().AimSpringAt(vel.Magnitude().Amplify(0.075f).Offset(1f).ToVector2(), 0.12f, 0.7f);

scaling_by_velocity

Circular + Noise

g.MotionP().Circular(83f, 0.25f).Fbm(new Vector2(2f, 3f), 3).Amplify(6f);

circular noise

Follow move

Func<Vector2> p = () => GetMousePosition();
g.MotionP().AimCriticalDampingAt(p, 0.8f);

follow

Follow + Circular move

Func<Vector2> p = () => GetMousePosition();
g.MotionP().AimCriticalDampingAt(p, 0.8f).Circular(83f, 1.5f);

follow circular

Follow + Follow + Follow

System.Func<Vector2> gp = () => new Vector2(g.transform.localPosition.x, g.transform.localPosition.y);
g.MotionP().AimCriticalDampingAt(p, 0.8f);
f1.MotionP().AimCriticalDampingAt(gp, 0.3f).StartDelay(6f).AccelByRatio(new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f)) * 20f, 0.9f);
f2.MotionP().AimCriticalDampingAt(gp, 0.2f).StartDelay(9f).AccelByRatio(new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f)) * 15f, 0.9f);

follow follow

Aiming + Noise

var vel = default(IEnumerator<Vector2>);
var m = g.MotionP();
m.AimSpringAt(p, 0.1f, 0.45f).Capture(out vel);
m.Perlin(new Vector2(7f, 11f)).Amplify(vel.Magnitude().Amplify(1.2f));

aim noise

Spiral #2

for (var i = 0; i < 12; ++i) {
	g = GameObject.Instantiate(prefab);
	g.transform.SetParent(prefab.transform.parent);
	g.transform.localPosition = Vector3.zero;
	g.transform.localScale = Vector3.one;

	var angle = 30f * i;
	var radius = Velocity.AccelByRatio(218f, Source.Constant(0.92f)).Offset(83f);
	var speed = Velocity.AccelByRatio(0.75f, Source.Constant(0.94f)).Offset(0.01f);
	g.MotionP().Circular(radius, speed).Angle(angle).Fbm(new Vector2(0f, 1f), 3).AmplifyComponents(new Vector2(0f, 0.3f));
}

spiral_2

License

Copyright 2016 Oink Games, Inc. and other contributors.

Code licensed under the MIT License: http://opensource.org/licenses/MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].