|
|
|
@ -20,7 +20,20 @@ public class ParticleMover : MonoBehaviour |
|
|
|
void Update() |
|
|
|
void Update() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
foreach(var touch in Input.touches) |
|
|
|
if(Input.GetMouseButtonDown(0)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
AddPoint(-1, Input.mousePosition); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Input.GetMouseButton(0)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
UpdatePoint(-1, Input.mousePosition); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Input.GetMouseButtonUp(0)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
RemovePoint(-1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var touch in Input.touches) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (touch.phase) |
|
|
|
switch (touch.phase) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -60,7 +73,12 @@ public class ParticleMover : MonoBehaviour |
|
|
|
public void AddPoint(int id, Vector2 pos) |
|
|
|
public void AddPoint(int id, Vector2 pos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
Transform newTransform = null; |
|
|
|
Transform newTransform = null; |
|
|
|
|
|
|
|
if(_pointGroup.TryGetValue(id, out newTransform)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
UpdatePos(newTransform, pos); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(_recycle.Count > 0) |
|
|
|
if(_recycle.Count > 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|