1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2026-02-04 14:24:55 +08:00

- updated Unity references in library

This commit is contained in:
Daniele Giardini 2019-12-12 12:02:45 +01:00
parent e6aa8c3b25
commit 90219d37ba
19 changed files with 84 additions and 18 deletions

View File

@ -1,6 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d3e15b806a8368742ba6f10e794d7b76 guid: d3e15b806a8368742ba6f10e794d7b76
timeCreated: 1571751690 timeCreated: 1575368396
licenseType: Pro licenseType: Pro
TextureImporter: TextureImporter:
fileIDToRecycleName: {} fileIDToRecycleName: {}

View File

@ -11,17 +11,83 @@ using UnityEngine.UI;
public class TempTests : BrainBase public class TempTests : BrainBase
{ {
Tween _tScale, _tMove; private Sequence parent;
private float duration;
void Start() // 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); if (Input.GetKeyUp(KeyCode.F5)) {
_tMove = transform.DOMoveX(2, 1).SetLoops(999); DOTween.KillAll();
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
} }
void OnDisable() if (Input.GetKeyUp(KeyCode.DownArrow))
{ {
_tScale.Complete(); Debug.Log("Create child");
_tMove.Complete(); createChild();
}
if (Input.GetKeyUp(KeyCode.UpArrow))
{
Debug.Log("Create parent");
createParent();
}
}
public void createParent()
{
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());
} }
} }

View File

@ -64,7 +64,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="UnityEngine"> <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> <Private>False</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>

View File

@ -64,11 +64,11 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="UnityEditor"> <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> <Private>False</Private>
</Reference> </Reference>
<Reference Include="UnityEngine"> <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> <Private>False</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>

View File

@ -41,11 +41,11 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="UnityEditor"> <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> <Private>False</Private>
</Reference> </Reference>
<Reference Include="UnityEngine"> <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> <Private>False</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>

View File

@ -48,15 +48,15 @@
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="UnityEditor"> <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> <Private>False</Private>
</Reference> </Reference>
<Reference Include="UnityEngine"> <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> <Private>False</Private>
</Reference> </Reference>
<Reference Include="UnityEngine.UI"> <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> <Private>False</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>

Binary file not shown.