|
|
|
@ -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,20 +55,36 @@ namespace Fungus
|
|
|
|
|
/// </summary> |
|
|
|
|
public virtual void OnDragStarted(Draggable2D draggableObject) |
|
|
|
|
{ |
|
|
|
|
if (draggableObject == this.draggableObject) |
|
|
|
|
for (int i = 0; i < this.draggableObjects.Count; i++) |
|
|
|
|
{ |
|
|
|
|
ExecuteBlock(); |
|
|
|
|
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) |
|
|
|
|
{ |
|
|
|
|
summary += draggableObjects[i].name + ","; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return summary; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
return draggableObject.name; |
|
|
|
|
return "None"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return "None"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|