minigame hole dokončeno
This commit is contained in:
@@ -34,7 +34,7 @@ public class DraggableObject : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
rb.useGravity = false;
|
||||
rb.useGravity = true;
|
||||
rb.constraints = RigidbodyConstraints.FreezeRotation;
|
||||
targetPosition = transform.position;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class DraggableObject : MonoBehaviour
|
||||
{
|
||||
HandleInput();
|
||||
}
|
||||
void FixedUpdate()
|
||||
void FixedUpdate()
|
||||
{
|
||||
if (isDragging)
|
||||
{
|
||||
@@ -73,9 +73,10 @@ public class DraggableObject : MonoBehaviour
|
||||
else
|
||||
{
|
||||
//Vector3 worldPos = mainCamera.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10f));
|
||||
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
TryStartDrag(Input.mousePosition);
|
||||
}
|
||||
else if (Input.GetMouseButton(0) && isDragging)
|
||||
UpdateDrag(Input.mousePosition);
|
||||
else if (Input.GetMouseButtonUp(0) && isDragging)
|
||||
|
||||
@@ -9,7 +9,7 @@ public class LevelManager : MonoBehaviour, ITask
|
||||
|
||||
[Header("Nastavení levelu")]
|
||||
[Tooltip("Kolik itemů musí hráč trefit pro splnění levelu")]
|
||||
public int itemsToScore = 3;
|
||||
public int itemsToScore = 2;
|
||||
|
||||
[Header("Event – vyvolá se po trefení všech itemů")]
|
||||
public UnityEvent OnAllItemsScored;
|
||||
|
||||
@@ -24,10 +24,10 @@ public class ObjectSpawner : MonoBehaviour
|
||||
public float holeMoveSpeed = 2f;
|
||||
|
||||
[Header("Spawn hranice (odpovídají kameře)")]
|
||||
public float minX = -3.5f;
|
||||
public float maxX = 3.5f;
|
||||
public float minY = -5f;
|
||||
public float maxY = 4f;
|
||||
public float minX = 1f;
|
||||
public float maxX = 1f;
|
||||
public float minY = 0f;
|
||||
public float maxY = 1f;
|
||||
|
||||
|
||||
private List<GameObject> spawnedObjects = new List<GameObject>();
|
||||
@@ -94,6 +94,7 @@ public class ObjectSpawner : MonoBehaviour
|
||||
|
||||
spawnedObjects.Add(obj);
|
||||
}
|
||||
Time.timeScale = 1f;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
@@ -107,8 +108,8 @@ public class ObjectSpawner : MonoBehaviour
|
||||
Vector3 RandomPos(float margin)
|
||||
{
|
||||
return new Vector3(
|
||||
Random.Range(minX + margin, maxX - margin),
|
||||
Random.Range(minY + margin, maxY - margin),
|
||||
-2.24f,//Random.Range(minX + margin, maxX - margin),
|
||||
0f,//Random.Range(minY + margin, maxY - margin),
|
||||
0.5f
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user