Browse Source

Clickable2D and Dragable2D components can now use legacy input or EventSystem events / recasts.

Added DragAndDrop(EventSystem) example scene to show how to use the EventSystem option.
master
Christopher 9 years ago
parent
commit
98d8fd089e
  1. 116
      Assets/Fungus/Sprite/Scripts/Clickable2D.cs
  2. 251
      Assets/Fungus/Sprite/Scripts/Draggable2D.cs
  3. 1809
      Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity
  4. 8
      Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity.meta
  5. 255
      Assets/FungusExamples/DragAndDrop/DragAndDrop.unity

116
Assets/Fungus/Sprite/Scripts/Clickable2D.cs

@ -10,10 +10,10 @@ namespace Fungus
{
/**
* Detects mouse clicks and touches on a Game Object, and sends an event to all Flowchart event handlers in the scene.
* The Game Object must have a Collider2D component attached.
* The Game Object must have a Collider or Collider2D component attached.
* Use in conjunction with the ObjectClicked Flowchart event handler.
*/
public class Clickable2D : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler
public class Clickable2D : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
{
[Tooltip("Is object clicking enabled")]
public bool clickEnabled = true;
@ -21,27 +21,88 @@ namespace Fungus
[Tooltip("Mouse texture to use when hovering mouse over object")]
public Texture2D hoverCursor;
protected virtual void Start()
[Tooltip("Use the UI Event System to check for clicks. Clicks that hit an overlapping UI object will be ignored. Camera must have a PhysicsRaycaster component, or a Physics2DRaycaster for 2D colliders.")]
public bool useEventSystem;
#region Legacy OnMouseX methods
protected virtual void OnMouseDown()
{
if (!useEventSystem)
{
DoPointerClick();
}
}
protected virtual void OnMouseEnter()
{
if (!useEventSystem)
{
DoPointerEnter();
}
}
protected virtual void OnMouseExit()
{
if (!useEventSystem)
{
DoPointerExit();
}
}
#endregion
#region IPointerXHandler implementations
public void OnPointerClick(PointerEventData eventData)
{
// If the main camera doesn't already have a Physics2DRaycaster then add one automatically to
// use UI raycasts for hit detection. This allows UI to block clicks on objects behind.
if (Camera.main == null)
return;
var raycast = Camera.main.GetComponent<Physics2DRaycaster>();
if (raycast == null)
{
Camera.main.gameObject.AddComponent<Physics2DRaycaster>();
}
if (useEventSystem)
{
DoPointerClick();
}
}
protected virtual void OnMouseExit()
public void OnPointerEnter(PointerEventData eventData)
{
if (useEventSystem)
{
DoPointerEnter();
}
}
public void OnPointerExit(PointerEventData eventData)
{
if (useEventSystem)
{
DoPointerExit();
}
}
protected virtual void DoPointerClick()
{
if (!clickEnabled)
{
return;
}
// TODO: Cache these objects for faster lookup
ObjectClicked[] handlers = GameObject.FindObjectsOfType<ObjectClicked>();
foreach (ObjectClicked handler in handlers)
{
handler.OnObjectClicked(this);
}
}
protected virtual void DoPointerEnter()
{
ChangeCursor(hoverCursor);
}
protected virtual void DoPointerExit()
{
// Always reset the mouse cursor to be on the safe side
SetMouseCursor.ResetMouseCursor();
}
#endregion
protected virtual void changeCursor(Texture2D cursorTexture)
protected virtual void ChangeCursor(Texture2D cursorTexture)
{
if (!clickEnabled)
{
@ -50,30 +111,5 @@ namespace Fungus
Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto);
}
#region IPointerClickHandler implementation
public void OnPointerClick(PointerEventData eventData)
{
if (!clickEnabled)
{
return;
}
// TODO: Cache these object for faster lookup
ObjectClicked[] handlers = GameObject.FindObjectsOfType<ObjectClicked>();
foreach (ObjectClicked handler in handlers)
{
handler.OnObjectClicked(this);
}
}
#endregion
#region IPointerEnterHandler
public void OnPointerEnter(PointerEventData eventData)
{
changeCursor(hoverCursor);
}
#endregion
}
}

251
Assets/Fungus/Sprite/Scripts/Draggable2D.cs

@ -18,7 +18,7 @@ namespace Fungus
* The RigidBody would typically have the Is Kinematic property set to true, unless you want the object to move around using physics.
* Use in conjunction with the Drag Started, Drag Completed, Drag Cancelled, Drag Entered & Drag Exited event handlers.
*/
public class Draggable2D : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
public class Draggable2D : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerEnterHandler, IPointerExitHandler
{
[Tooltip("Is object dragging enabled")]
public bool dragEnabled = true;
@ -36,25 +36,14 @@ namespace Fungus
[Tooltip("Mouse texture to use when hovering mouse over object")]
public Texture2D hoverCursor;
[Tooltip("Use the UI Event System to check for drag events. Clicks that hit an overlapping UI object will be ignored. Camera must have a PhysicsRaycaster component, or a Physics2DRaycaster for 2D colliders.")]
public bool useEventSystem;
protected Vector3 startingPosition;
protected bool updatePosition = false;
protected Vector3 newPosition;
protected Vector3 delta = Vector3.zero;
protected virtual void Start()
{
// If the main camera doesn't already have a Physics2DRaycaster then add one automatically to
// use UI raycasts for hit detection. This allows UI to block clicks on objects behind.
if (Camera.main == null)
return;
var raycast = Camera.main.GetComponent<Physics2DRaycaster>();
if (raycast == null)
{
Camera.main.gameObject.AddComponent<Physics2DRaycaster>();
}
}
protected virtual void LateUpdate()
{
// iTween will sometimes override the object position even if it should only be affecting the scale, rotation, etc.
@ -108,105 +97,181 @@ namespace Fungus
return GameObject.FindObjectsOfType<T>();
}
protected virtual void OnMouseEnter()
#region Legacy OnMouseX methods
protected virtual void OnMouseDown()
{
changeCursor(hoverCursor);
if (!useEventSystem)
{
DoBeginDrag();
}
}
protected virtual void OnMouseExit()
protected virtual void OnMouseDrag()
{
SetMouseCursor.ResetMouseCursor();
if (!useEventSystem)
{
DoDrag();
}
}
protected virtual void changeCursor(Texture2D cursorTexture)
protected virtual void OnMouseUp()
{
if (!dragEnabled)
if (!useEventSystem)
{
return;
DoEndDrag();
}
}
Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto);
protected virtual void OnMouseEnter()
{
if (!useEventSystem)
{
DoPointerEnter();
}
}
protected virtual void OnMouseExit()
{
if (!useEventSystem)
{
DoPointerExit();
}
}
#endregion
#region IBeginDragHandler implementation
#region Pointer and Drag handler implementations
public void OnBeginDrag(PointerEventData eventData)
{
// Offset the object so that the drag is anchored to the exact point where the user clicked it
float x = Input.mousePosition.x;
float y = Input.mousePosition.y;
delta = Camera.main.ScreenToWorldPoint(new Vector3(x, y, 10f)) - transform.position;
delta.z = 0f;
startingPosition = transform.position;
foreach (DragStarted handler in GetHandlers<DragStarted>())
{
handler.OnDragStarted(this);
}
if (useEventSystem)
{
DoBeginDrag();
}
}
#endregion
#region IDragHandler implementation
public void OnDrag(PointerEventData eventData)
public void OnDrag(PointerEventData eventData)
{
if (!dragEnabled)
{
return;
}
float x = Input.mousePosition.x;
float y = Input.mousePosition.y;
float z = transform.position.z;
newPosition = Camera.main.ScreenToWorldPoint(new Vector3(x, y, 10f)) - delta;
newPosition.z = z;
updatePosition = true;
if (useEventSystem)
{
DoDrag();
}
}
#endregion
#region IEndHandler implementation
public void OnEndDrag(PointerEventData eventData)
public void OnEndDrag(PointerEventData eventData)
{
if (!dragEnabled)
{
return;
}
bool dragCompleted = false;
DragCompleted[] handlers = GetHandlers<DragCompleted>();
foreach (DragCompleted handler in handlers)
{
if (handler.draggableObject == this)
{
if (handler.IsOverTarget())
{
handler.OnDragCompleted(this);
dragCompleted = true;
if (returnOnCompleted)
{
LeanTween.move(gameObject, startingPosition, returnDuration).setEase(LeanTweenType.easeOutExpo);
}
}
}
}
if (!dragCompleted)
{
foreach (DragCancelled handler in GetHandlers<DragCancelled>())
{
handler.OnDragCancelled(this);
}
if (returnOnCancelled)
{
LeanTween.move(gameObject, startingPosition, returnDuration).setEase(LeanTweenType.easeOutExpo);
}
}
if (useEventSystem)
{
DoEndDrag();
}
}
#endregion
}
public void OnPointerEnter(PointerEventData eventData)
{
if (useEventSystem)
{
DoPointerEnter();
}
}
public void OnPointerExit(PointerEventData eventData)
{
if (useEventSystem)
{
DoPointerExit();
}
}
#endregion
protected virtual void DoBeginDrag()
{
// Offset the object so that the drag is anchored to the exact point where the user clicked it
float x = Input.mousePosition.x;
float y = Input.mousePosition.y;
delta = Camera.main.ScreenToWorldPoint(new Vector3(x, y, 10f)) - transform.position;
delta.z = 0f;
startingPosition = transform.position;
foreach (DragStarted handler in GetHandlers<DragStarted>())
{
handler.OnDragStarted(this);
}
}
protected virtual void DoDrag()
{
if (!dragEnabled)
{
return;
}
float x = Input.mousePosition.x;
float y = Input.mousePosition.y;
float z = transform.position.z;
newPosition = Camera.main.ScreenToWorldPoint(new Vector3(x, y, 10f)) - delta;
newPosition.z = z;
updatePosition = true;
}
protected virtual void DoEndDrag()
{
if (!dragEnabled)
{
return;
}
bool dragCompleted = false;
DragCompleted[] handlers = GetHandlers<DragCompleted>();
foreach (DragCompleted handler in handlers)
{
if (handler.draggableObject == this)
{
if (handler.IsOverTarget())
{
handler.OnDragCompleted(this);
dragCompleted = true;
if (returnOnCompleted)
{
LeanTween.move(gameObject, startingPosition, returnDuration).setEase(LeanTweenType.easeOutExpo);
}
}
}
}
if (!dragCompleted)
{
foreach (DragCancelled handler in GetHandlers<DragCancelled>())
{
handler.OnDragCancelled(this);
}
if (returnOnCancelled)
{
LeanTween.move(gameObject, startingPosition, returnDuration).setEase(LeanTweenType.easeOutExpo);
}
}
}
protected virtual void DoPointerEnter()
{
ChangeCursor(hoverCursor);
}
protected virtual void DoPointerExit()
{
SetMouseCursor.ResetMouseCursor();
}
protected virtual void ChangeCursor(Texture2D cursorTexture)
{
if (!dragEnabled)
{
return;
}
Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto);
}
}
}

1809
Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity

File diff suppressed because it is too large Load Diff

8
Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ac2d2f4f211244eb98a7872c71dafa21
timeCreated: 1469447260
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

255
Assets/FungusExamples/DragAndDrop/DragAndDrop.unity

@ -8,25 +8,25 @@ SceneSettings:
m_PVSPortalsArray: []
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
smallestHole: .25
backfaceThreshold: 100
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 6
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogColor: {r: .5, g: .5, b: .5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_FogDensity: .00999999978
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1}
m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1}
m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_HaloStrength: .5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
@ -37,10 +37,13 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
--- !u!127 &3
LevelGameManager:
m_ObjectHideFlags: 0
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 6
serializedVersion: 5
m_GIWorkflowMode: 1
m_LightmapsMode: 1
m_GISettings:
@ -65,8 +68,7 @@ LightmapSettings:
m_TextureCompression: 0
m_FinalGather: 0
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_LightingDataAsset: {fileID: 0}
m_LightmapSnapshot: {fileID: 0}
m_RuntimeCPUUsage: 25
--- !u!196 &5
NavMeshSettings:
@ -74,15 +76,15 @@ NavMeshSettings:
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentRadius: 0.5
agentRadius: .5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
agentClimb: .400000006
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
accuratePlacement: 0
minRegionArea: 2
cellSize: 0.16666666
cellSize: .166666657
manualCellSize: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &19757133
@ -155,10 +157,8 @@ Canvas:
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &19757137
RectTransform:
m_ObjectHideFlags: 0
@ -168,12 +168,11 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 245689044}
- {fileID: 2096462795}
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 7
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
@ -216,20 +215,12 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2}
propertyPath: m_RootOrder
value: 3
value: 4
objectReference: {fileID: 0}
- target: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2}
propertyPath: m_Name
value: ClickableSprite1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2}
propertyPath: hoverOverCursorTexture
value:
objectReference: {fileID: 2800000, guid: 22eb050bacf8c401ca8503e24bff3570, type: 3}
- target: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2}
propertyPath: hoverCursor
value:
objectReference: {fileID: 2800000, guid: 22eb050bacf8c401ca8503e24bff3570, type: 3}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2}
m_IsPrefabParent: 0
@ -260,16 +251,15 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 349486055}
m_Father: {fileID: 19757137}
m_RootOrder: 0
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchorMin: {x: .5, y: .5}
m_AnchorMax: {x: .5, y: .5}
m_AnchoredPosition: {x: -166, y: 63}
m_SizeDelta: {x: 185, y: 65}
m_Pivot: {x: 0.5, y: 0.5}
m_Pivot: {x: .5, y: .5}
--- !u!114 &245689045
MonoBehaviour:
m_ObjectHideFlags: 0
@ -290,11 +280,11 @@ MonoBehaviour:
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1}
m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_FadeDuration: .100000001
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
@ -324,12 +314,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
@ -356,7 +340,6 @@ GameObject:
- 92: {fileID: 268187670}
- 124: {fileID: 268187669}
- 81: {fileID: 268187668}
- 114: {fileID: 268187673}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
@ -394,14 +377,14 @@ Camera:
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
near clip plane: .300000012
far clip plane: 1000
field of view: 60
orthographic: 1
@ -413,12 +396,10 @@ Camera:
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
m_StereoSeparation: .0219999999
--- !u!4 &268187672
Transform:
m_ObjectHideFlags: 0
@ -426,26 +407,11 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 268187667}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.05, y: -0.54, z: -10}
m_LocalPosition: {x: -.0500000007, y: -.540000021, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!114 &268187673
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 268187667}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -1690312454, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EventMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &299700058
GameObject:
m_ObjectHideFlags: 1
@ -483,10 +449,9 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 0
--- !u!1 &349486054
GameObject:
m_ObjectHideFlags: 0
@ -513,7 +478,6 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 245689044}
m_RootOrder: 0
@ -521,7 +485,7 @@ RectTransform:
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
m_Pivot: {x: .5, y: .5}
--- !u!114 &349486056
MonoBehaviour:
m_ObjectHideFlags: 0
@ -534,13 +498,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1}
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
@ -549,7 +507,6 @@ MonoBehaviour:
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
@ -603,30 +560,70 @@ Prefab:
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2}
m_IsPrefabParent: 0
--- !u!1 &591590528 stripped
--- !u!1 &591590528
GameObject:
m_PrefabParentObject: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2}
m_PrefabInternal: {fileID: 1373034542}
--- !u!114 &591590529 stripped
--- !u!114 &591590529
MonoBehaviour:
m_PrefabParentObject: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177,
type: 2}
m_PrefabInternal: {fileID: 1373034542}
m_Script: {fileID: 11500000, guid: cc03961113fa349c09cb06ef2911013d, type: 3}
--- !u!1 &606394391 stripped
--- !u!1 &606394391
GameObject:
m_PrefabParentObject: {fileID: 100000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2}
m_PrefabInternal: {fileID: 442175927}
--- !u!58 &606394392 stripped
--- !u!58 &606394392
CircleCollider2D:
m_PrefabParentObject: {fileID: 5800000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b,
type: 2}
m_PrefabInternal: {fileID: 442175927}
--- !u!1 &1081858233 stripped
--- !u!1 &807929237
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 807929239}
- 114: {fileID: 807929238}
m_Layer: 0
m_Name: TestRunner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &807929238
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 807929237}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5c3afc1c624179749bcdecf7b0224902, type: 3}
m_Name:
m_EditorClassIdentifier:
currentTest: {fileID: 0}
--- !u!4 &807929239
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 807929237}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
--- !u!1 &1081858233
GameObject:
m_PrefabParentObject: {fileID: 100000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2}
m_PrefabInternal: {fileID: 2135880372}
--- !u!114 &1081858236 stripped
--- !u!114 &1081858236
MonoBehaviour:
m_PrefabParentObject: {fileID: 11400000, guid: 4d55f86cf3b124c8fb1158da26ffa96d,
type: 2}
@ -660,11 +657,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8c0cbb63e218a4414a796a60ffe37dd3, type: 3}
m_Name:
m_EditorClassIdentifier:
info: "This example shows using clickable and draggable sprites. Click and drag
events are handled by Blocks in the Flowchart.\n\nIf you click on the UI buttons
the clicks are correctly blocked from affecting the clickable / draggable objects
behind. \n\nNote the Camera has a Physics2DRaycaster component to allow this to
work. For 3D objects, use a Physics3DRaycaster on the camera instead."
info: 'This example shows using clickable and draggable sprites. Click and drag
events are handled by Blocks in the Flowchart using the Object Clicked and Drag
X event handlers.
By default, clickable and draggable objects will receive clicks "through" UI elements
like the buttons below. See the DragAndDrop(EventSystem) example for how block
these clicks on UI objects.
'
--- !u!4 &1192690129
Transform:
m_ObjectHideFlags: 0
@ -674,7 +677,6 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
@ -715,7 +717,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2}
propertyPath: m_RootOrder
value: 4
value: 5
objectReference: {fileID: 0}
- target: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2}
propertyPath: m_Name
@ -780,8 +782,7 @@ MonoBehaviour:
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
m_AllowActivationOnMobileDevice: 0
--- !u!114 &1597904420
MonoBehaviour:
m_ObjectHideFlags: 0
@ -805,15 +806,14 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
--- !u!1 &1637100245 stripped
m_RootOrder: 8
--- !u!1 &1637100245
GameObject:
m_PrefabParentObject: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2}
m_PrefabInternal: {fileID: 228925351}
--- !u!114 &1637100246 stripped
--- !u!114 &1637100246
MonoBehaviour:
m_PrefabParentObject: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177,
type: 2}
@ -845,7 +845,6 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 2096462795}
m_RootOrder: 0
@ -853,7 +852,7 @@ RectTransform:
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
m_Pivot: {x: .5, y: .5}
--- !u!114 &1966497755
MonoBehaviour:
m_ObjectHideFlags: 0
@ -866,13 +865,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1}
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
@ -881,7 +874,6 @@ MonoBehaviour:
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
@ -962,9 +954,8 @@ MonoBehaviour:
y: -452
width: 1887
height: 1080
selectedBlock: {fileID: 2019116698}
selectedCommands:
- {fileID: 2019116697}
selectedBlock: {fileID: 2019116687}
selectedCommands: []
variables: []
description: 'This scene shows how to set up a drag-and-drop
@ -976,6 +967,8 @@ MonoBehaviour:
localizationId:
showLineNumbers: 0
hideCommands: []
luaEnvironment: {fileID: 0}
luaBindingName: flowchart
--- !u!114 &2019116669
MonoBehaviour:
m_ObjectHideFlags: 2
@ -1054,7 +1047,7 @@ MonoBehaviour:
durationOLD: 0
_offset:
vector3Ref: {fileID: 0}
vector3Val: {x: 0.5, y: 0.5, z: 0}
vector3Val: {x: .5, y: .5, z: 0}
offsetOLD: {x: 0, y: 0, z: 0}
--- !u!114 &2019116672
MonoBehaviour:
@ -1139,7 +1132,7 @@ MonoBehaviour:
stringVal:
_duration:
floatRef: {fileID: 0}
floatVal: 0.1
floatVal: .100000001
easeType: 2
loopType: 0
stopPreviousTweens: 0
@ -1149,7 +1142,7 @@ MonoBehaviour:
durationOLD: 0
_offset:
vector3Ref: {fileID: 0}
vector3Val: {x: -0.25, y: -0.25, z: 0}
vector3Val: {x: -.25, y: -.25, z: 0}
offsetOLD: {x: 0, y: 0, z: 0}
--- !u!114 &2019116677
MonoBehaviour:
@ -1173,7 +1166,7 @@ MonoBehaviour:
stringVal:
_duration:
floatRef: {fileID: 0}
floatVal: 0.1
floatVal: .100000001
easeType: 2
loopType: 0
stopPreviousTweens: 0
@ -1183,7 +1176,7 @@ MonoBehaviour:
durationOLD: 0
_offset:
vector3Ref: {fileID: 0}
vector3Val: {x: 0.25, y: 0.25, z: 0}
vector3Val: {x: .25, y: .25, z: 0}
offsetOLD: {x: 0, y: 0, z: 0}
--- !u!114 &2019116678
MonoBehaviour:
@ -1413,12 +1406,11 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2019116667}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -1.16, y: 0.34, z: 0}
m_LocalPosition: {x: -1.15999997, y: .340000004, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 6
--- !u!114 &2019116690
MonoBehaviour:
m_ObjectHideFlags: 2
@ -1580,7 +1572,7 @@ MonoBehaviour:
durationOLD: 0
_amount:
vector3Ref: {fileID: 0}
vector3Val: {x: 0.5, y: 0.5, z: 0}
vector3Val: {x: .5, y: .5, z: 0}
amountOLD: {x: 0, y: 0, z: 0}
--- !u!114 &2019116696
MonoBehaviour:
@ -1597,7 +1589,7 @@ MonoBehaviour:
clickableObject: {fileID: 591590529}
--- !u!114 &2019116697
MonoBehaviour:
m_ObjectHideFlags: 0
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2019116667}
@ -1613,7 +1605,7 @@ MonoBehaviour:
hotSpot: {x: 0, y: 0}
--- !u!114 &2019116698
MonoBehaviour:
m_ObjectHideFlags: 0
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2019116667}
@ -1636,7 +1628,7 @@ MonoBehaviour:
- {fileID: 2019116697}
--- !u!114 &2019116699
MonoBehaviour:
m_ObjectHideFlags: 0
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2019116667}
@ -1673,16 +1665,15 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1966497754}
m_Father: {fileID: 19757137}
m_RootOrder: 1
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchorMin: {x: .5, y: .5}
m_AnchorMax: {x: .5, y: .5}
m_AnchoredPosition: {x: -166, y: -157}
m_SizeDelta: {x: 185, y: 65}
m_Pivot: {x: 0.5, y: 0.5}
m_Pivot: {x: .5, y: .5}
--- !u!114 &2096462796
MonoBehaviour:
m_ObjectHideFlags: 0
@ -1703,11 +1694,11 @@ MonoBehaviour:
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1}
m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_FadeDuration: .100000001
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
@ -1737,12 +1728,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
@ -1794,12 +1779,8 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2}
propertyPath: m_RootOrder
value: 1
value: 2
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2}
propertyPath: hoverCursor
value:
objectReference: {fileID: 2800000, guid: 22eb050bacf8c401ca8503e24bff3570, type: 3}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2}
m_IsPrefabParent: 0

Loading…
Cancel
Save