void Update() { if (MPTKeepShapeAnimation.GetAnimationsCount() != 0) { return; } if (MPTInteractiveTutoManager.Instance.currentTuto != null) { return; } if (isDirty) { QuickSave(); isDirty = false; } }
void Update() { if (MPTKeepShapeAnimation.GetAnimationsCount() != 0) { return; } if (MPTGameManager.Instance != null && MPTGameManager.Instance.isPaused) { if (currentlyDragged) { if (beenDropped != null) { beenDropped(); } } currentlyDragged = false; return; } Vector2 initPosition = new Vector2(float.MinValue, float.MinValue); Vector2 position = initPosition; bool justClicked = false; #if UNITY_EDITOR if (Input.GetMouseButtonDown(0)) { justClicked = true; position = Input.mousePosition; } else if (Input.GetMouseButton(0)) { position = Input.mousePosition; } #endif if (Input.touchCount == 1) { if (Input.touches[0].phase == TouchPhase.Began) { justClicked = true; } position = Input.touches[0].position; } if (position == initPosition) { if (currentlyDragged) { if (beenDropped != null) { beenDropped(); } } currentlyDragged = false; return; } position = MPTUtils.ScreenToWorld(position); if (coll.OverlapPoint(position)) { if (justClicked) { currentlyDragged = true; } } foreach (Collider2D currColl in additionalColliders) { if (currColl.OverlapPoint(position)) { if (justClicked) { currentlyDragged = true; } } } if (MPTInteractiveTutoManager.Instance.BlockadeDragPiece(gameObject.GetComponent <MPTShape>()) == false) { currentlyDragged = false; } if (currentlyDragged) { transform.position = new Vector3(position.x, position.y + 2.0f, 0.0f); } if (currentlyDragged && beenDragged != null) { beenDragged(); } }