dominiku pomoc
This commit is contained in:
@@ -1611,7 +1611,8 @@ GameObject:
|
||||
- component: {fileID: 727261130}
|
||||
- component: {fileID: 727261129}
|
||||
- component: {fileID: 727261128}
|
||||
- component: {fileID: 727261127}
|
||||
- component: {fileID: 727261133}
|
||||
- component: {fileID: 727261132}
|
||||
- component: {fileID: 727261131}
|
||||
m_Layer: 0
|
||||
m_Name: Sphere
|
||||
@@ -1620,27 +1621,6 @@ GameObject:
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!135 &727261127
|
||||
SphereCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 727261126}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Radius: 0.5
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &727261128
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1712,33 +1692,87 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!54 &727261131
|
||||
Rigidbody:
|
||||
--- !u!50 &727261131
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 727261126}
|
||||
serializedVersion: 5
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_GravityScale: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ImplicitCom: 1
|
||||
m_ImplicitTensor: 1
|
||||
m_UseGravity: 1
|
||||
m_IsKinematic: 0
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
m_Constraints: 0
|
||||
--- !u!114 &727261132
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 727261126}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fb5157d7cd78450439c40cd6f5afe6ac, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::DraggableObject
|
||||
dragSmoothness: 15
|
||||
spriteRenderer: {fileID: 0}
|
||||
normalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
dragColor: {r: 1, g: 1, b: 0.5, a: 1}
|
||||
scaleOnDrag: 1.15
|
||||
--- !u!70 &727261133
|
||||
CapsuleCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 727261126}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 1
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_Direction: 0
|
||||
--- !u!1 &776138489
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2480,7 +2514,6 @@ GameObject:
|
||||
- component: {fileID: 992725604}
|
||||
- component: {fileID: 992725603}
|
||||
- component: {fileID: 992725602}
|
||||
- component: {fileID: 992725606}
|
||||
m_Layer: 0
|
||||
m_Name: zem (11)
|
||||
m_TagString: Untagged
|
||||
@@ -2580,30 +2613,6 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
|
||||
--- !u!114 &992725606
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 992725601}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 071f79f81861c2741a92d8b044457d94, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::ObjectSpawner
|
||||
objectPrefabs: []
|
||||
holePrefab: {fileID: 727261126}
|
||||
objectCount: 67
|
||||
holeCount: 2
|
||||
holesMove: 0
|
||||
holeMoveSpeed: 2
|
||||
minX: -1
|
||||
maxX: -1
|
||||
minY: -1
|
||||
maxY: -1
|
||||
objectParent: {fileID: 0}
|
||||
holeParent: {fileID: 0}
|
||||
--- !u!1 &1027132177
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3048,6 +3057,63 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
||||
--- !u!1 &1190939573
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1190939575}
|
||||
- component: {fileID: 1190939574}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1190939574
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1190939573}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 071f79f81861c2741a92d8b044457d94, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::ObjectSpawner
|
||||
objectPrefabs:
|
||||
- {fileID: 727261126}
|
||||
holePrefab: {fileID: 6503149}
|
||||
objectCount: 3
|
||||
holeCount: 0
|
||||
holesMove: 0
|
||||
holeMoveSpeed: 2
|
||||
minX: -3.5
|
||||
maxX: 3.5
|
||||
minY: -5
|
||||
maxY: 4
|
||||
objectParent: {fileID: 727261130}
|
||||
holeParent: {fileID: 6503154}
|
||||
--- !u!4 &1190939575
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1190939573}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -9.13, y: -1.09, z: 0.18235}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1238253560
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -4819,8 +4885,8 @@ BoxCollider:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_IsTrigger: 1
|
||||
m_ProvidesContacts: 1
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
@@ -5140,3 +5206,4 @@ SceneRoots:
|
||||
- {fileID: 266619206}
|
||||
- {fileID: 795613421}
|
||||
- {fileID: 448778205}
|
||||
- {fileID: 1190939575}
|
||||
|
||||
@@ -25,7 +25,6 @@ public class DraggableObject : MonoBehaviour
|
||||
rb = GetComponent<Rigidbody2D>();
|
||||
mainCamera = Camera.main;
|
||||
originalScale = transform.localScale;
|
||||
|
||||
if (spriteRenderer == null)
|
||||
spriteRenderer = GetComponent<SpriteRenderer>();
|
||||
}
|
||||
@@ -40,33 +39,38 @@ public class DraggableObject : MonoBehaviour
|
||||
void Update()
|
||||
{
|
||||
HandleInput();
|
||||
|
||||
if (isDragging)
|
||||
transform.position = Vector3.Lerp(transform.position, targetPosition, Time.deltaTime * dragSmoothness);
|
||||
}
|
||||
|
||||
void HandleInput()
|
||||
{
|
||||
|
||||
if (Input.touchCount > 0)
|
||||
{
|
||||
Touch touch = Input.GetTouch(0);
|
||||
Vector3 worldPos = mainCamera.ScreenToWorldPoint(new Vector3(touch.position.x, touch.position.y, 10f));
|
||||
|
||||
if (touch.phase == TouchPhase.Began) TryStartDrag(worldPos);
|
||||
else if (touch.phase == TouchPhase.Moved ||
|
||||
touch.phase == TouchPhase.Stationary) { if (isDragging) targetPosition = worldPos; }
|
||||
else if (touch.phase == TouchPhase.Ended ||
|
||||
touch.phase == TouchPhase.Canceled) { if (isDragging) EndDrag(); }
|
||||
if (touch.phase == TouchPhase.Began)
|
||||
TryStartDrag(worldPos);
|
||||
else if (touch.phase == TouchPhase.Moved || touch.phase == TouchPhase.Stationary)
|
||||
{
|
||||
if (isDragging) targetPosition = worldPos;
|
||||
}
|
||||
else if (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled)
|
||||
{
|
||||
if (isDragging) EndDrag();
|
||||
}
|
||||
}
|
||||
// na twest pro myŠ
|
||||
else
|
||||
{
|
||||
Vector3 worldPos = mainCamera.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10f));
|
||||
|
||||
if (Input.GetMouseButtonDown(0)) TryStartDrag(worldPos);
|
||||
else if (Input.GetMouseButton(0) && isDragging) targetPosition = worldPos;
|
||||
else if (Input.GetMouseButtonUp(0) && isDragging) EndDrag();
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
TryStartDrag(worldPos);
|
||||
else if (Input.GetMouseButton(0) && isDragging)
|
||||
targetPosition = worldPos;
|
||||
else if (Input.GetMouseButtonUp(0) && isDragging)
|
||||
EndDrag();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +85,6 @@ public class DraggableObject : MonoBehaviour
|
||||
isDragging = true;
|
||||
rb.linearVelocity = Vector2.zero;
|
||||
targetPosition = worldPos;
|
||||
|
||||
transform.localScale = originalScale * scaleOnDrag;
|
||||
if (spriteRenderer != null)
|
||||
{
|
||||
@@ -106,7 +109,6 @@ public class DraggableObject : MonoBehaviour
|
||||
if (hasBeenScored) return;
|
||||
hasBeenScored = true;
|
||||
isDragging = false;
|
||||
|
||||
StartCoroutine(SinkIntoHole());
|
||||
}
|
||||
|
||||
@@ -127,7 +129,6 @@ public class DraggableObject : MonoBehaviour
|
||||
}
|
||||
|
||||
gameObject.SetActive(false);
|
||||
|
||||
LevelManager.Instance?.RegisterItem();
|
||||
}
|
||||
}
|
||||
8
Assets/_Recovery.meta
Normal file
8
Assets/_Recovery.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: afdea084fa9cd5c48871a9bcc84d95e0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
5277
Assets/_Recovery/0.unity
Normal file
5277
Assets/_Recovery/0.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/_Recovery/0.unity.meta
Normal file
7
Assets/_Recovery/0.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40a9261b0dbdcea4b9562c6a85f035ec
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -920,7 +920,7 @@ PlayerSettings:
|
||||
qnxGraphicConfPath:
|
||||
apiCompatibilityLevel: 6
|
||||
captureStartupLogs: {}
|
||||
activeInputHandler: 1
|
||||
activeInputHandler: 2
|
||||
windowsGamepadBackendHint: 0
|
||||
cloudProjectId: 8feb5b9d-fe4c-4652-bc44-283fb1a29892
|
||||
framebufferDepthMemorylessMode: 0
|
||||
|
||||
Reference in New Issue
Block a user