mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2026-02-04 06:14:55 +08:00
- updated Unity references in library
This commit is contained in:
parent
e6aa8c3b25
commit
90219d37ba
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3e15b806a8368742ba6f10e794d7b76
|
||||
timeCreated: 1571751690
|
||||
timeCreated: 1575368396
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
|
||||
@ -11,17 +11,83 @@ using UnityEngine.UI;
|
||||
|
||||
public class TempTests : BrainBase
|
||||
{
|
||||
Tween _tScale, _tMove;
|
||||
|
||||
void Start()
|
||||
private Sequence parent;
|
||||
private float duration;
|
||||
|
||||
// Empty Scene with 3 cubes next to each other named Cube1, Cube2, Cube3.
|
||||
// Empty game object with script on it. 2 check boxes in inspector to fire the methods.
|
||||
// Child sequence is a one off. Parent sequence has a restart on complete.
|
||||
// If you fire parent first, and the boxes do not adhere to the time they just fly away.
|
||||
// If you fire child first, then fire parent, and the parent sequence uses times.
|
||||
|
||||
void Update()
|
||||
{
|
||||
_tScale = transform.DOScale(0.5f, 1).SetLoops(999);
|
||||
_tMove = transform.DOMoveX(2, 1).SetLoops(999);
|
||||
if (Input.GetKeyUp(KeyCode.F5)) {
|
||||
DOTween.KillAll();
|
||||
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
|
||||
}
|
||||
|
||||
if (Input.GetKeyUp(KeyCode.DownArrow))
|
||||
{
|
||||
Debug.Log("Create child");
|
||||
createChild();
|
||||
}
|
||||
|
||||
if (Input.GetKeyUp(KeyCode.UpArrow))
|
||||
{
|
||||
Debug.Log("Create parent");
|
||||
createParent();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
|
||||
public void createParent()
|
||||
{
|
||||
_tScale.Complete();
|
||||
_tMove.Complete();
|
||||
parent = DOTween.Sequence()
|
||||
.SetAutoKill(false)
|
||||
.AppendCallback(() => createChild());
|
||||
Debug.Log("- " + duration);
|
||||
parent.AppendInterval(duration)
|
||||
.OnComplete(() => {
|
||||
Debug.Log("<color=#00ff00>RESTART</color>");
|
||||
parent.Restart();
|
||||
});
|
||||
}
|
||||
|
||||
public void createChild()
|
||||
{
|
||||
var listy = new List<GameObject>
|
||||
{
|
||||
GameObject.Find("Cube1"),
|
||||
GameObject.Find("Cube2"),
|
||||
GameObject.Find("Cube3")
|
||||
};
|
||||
|
||||
var child = DOTween.Sequence();
|
||||
setCallBack(listy, child);
|
||||
duration = child.Duration();
|
||||
Debug.Log(">>> duration: " + duration);
|
||||
}
|
||||
|
||||
private void setCallBack(List<GameObject> listy, Sequence child)
|
||||
{
|
||||
foreach (var thing in listy)
|
||||
{
|
||||
var rand = (float)rando();
|
||||
Debug.Log("Wait " + thing.name + " " + rand.ToString());
|
||||
child.AppendCallback(() => planToMove(thing.transform)).AppendInterval(rand); // move each, append a wait interval
|
||||
}
|
||||
}
|
||||
|
||||
public int rando()
|
||||
{
|
||||
var rnd = new System.Random();
|
||||
return rnd.Next(1, 5);
|
||||
}
|
||||
|
||||
public void planToMove(Transform thing)
|
||||
{
|
||||
var rand = rando();
|
||||
thing.DOMove(new Vector3(thing.position.x, thing.position.y, thing.position.z + rand), .5f); //move the z a random amount beween 1-3.
|
||||
Debug.Log("Move " + thing.name + " " + rand.ToString());
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@ -64,7 +64,7 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
<HintPath>C:\Program Files (x86)\Unity\4.6\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
@ -64,11 +64,11 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="UnityEditor">
|
||||
<HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEditor.dll</HintPath>
|
||||
<HintPath>C:\Program Files (x86)\Unity\4.6\Editor\Data\Managed\UnityEditor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
<HintPath>C:\Program Files (x86)\Unity\4.6\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
@ -41,11 +41,11 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="UnityEditor">
|
||||
<HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEditor.dll</HintPath>
|
||||
<HintPath>C:\Program Files (x86)\Unity\4.6\Editor\Data\Managed\UnityEditor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
<HintPath>C:\Program Files (x86)\Unity\4.6\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
@ -48,15 +48,15 @@
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="UnityEditor">
|
||||
<HintPath>C:\Program Files\Unity\Editor\Data\Managed\UnityEditor.dll</HintPath>
|
||||
<HintPath>C:\Program Files (x86)\Unity\4.6\Editor\Data\Managed\UnityEditor.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
<HintPath>C:\Program Files (x86)\Unity\4.6\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UI">
|
||||
<HintPath>C:\Program Files\Unity\Editor\Data\UnityExtensions\Unity\GUISystem\UnityEngine.UI.dll</HintPath>
|
||||
<HintPath>C:\Program Files (x86)\Unity\4.6\Editor\Data\UnityExtensions\Unity\GUISystem\4.6.0\UnityEngine.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user