|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) |
|
|
|
|
|
|
|
|
|
using UnityEngine; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
|
|
|
|
namespace Fungus |
|
|
|
|
{ |
|
|
|
@ -23,10 +24,11 @@ namespace Fungus
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[SerializeField] protected Draggable2D draggableObject; |
|
|
|
|
[SerializeField] protected List<Draggable2D> draggableObjects; |
|
|
|
|
|
|
|
|
|
protected EventDispatcher eventDispatcher; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected virtual void OnEnable() |
|
|
|
|
{ |
|
|
|
|
eventDispatcher = FungusManager.Instance.EventDispatcher; |
|
|
|
@ -53,22 +55,38 @@ namespace Fungus
|
|
|
|
|
/// </summary> |
|
|
|
|
public virtual void OnDragStarted(Draggable2D draggableObject) |
|
|
|
|
{ |
|
|
|
|
if (draggableObject == this.draggableObject) |
|
|
|
|
for (int i = 0; i < this.draggableObjects.Count; i++) |
|
|
|
|
{ |
|
|
|
|
if (draggableObject == this.draggableObjects[i]) |
|
|
|
|
{ |
|
|
|
|
ExecuteBlock(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string GetSummary() |
|
|
|
|
{ |
|
|
|
|
if (draggableObject != null) |
|
|
|
|
string summary = "Dragable: "; |
|
|
|
|
if (this.draggableObjects != null && this.draggableObjects.Count != 0) |
|
|
|
|
{ |
|
|
|
|
for (int i = 0; i < this.draggableObjects.Count; i++) |
|
|
|
|
{ |
|
|
|
|
if (draggableObjects[i] != null) |
|
|
|
|
{ |
|
|
|
|
return draggableObject.name; |
|
|
|
|
summary += draggableObjects[i].name + ","; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return summary; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
return "None"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|