public void ShootBubble(Vector2 direction) { Vector2 shootDirection = GetTouchDistanceFromGivenObject(direction, transform.position); shootDirection *= StandardCoefficient(shootDirection); if (shootingSuperBubble) { //Debug.Log("shoot super power"); superBubble.Move(shootDirection, finalPosition); shootingSuperBubble = false; selectedMoveableObj.DestroyMoveableObj(); unSelectedMoveableObj.DestroyMoveableObj(); StartCoroutine(SetMoveableObj(1)); StartCoroutine(SetMoveableObj(2)); superBubble = null; } else { selectedMoveableObj.Move(shootDirection, finalPosition); // swap selectedMoveableObj = unSelectedMoveableObj; selectedMoveableObj.ChangePosition(selectedMoveableObjPos, transform.position, false); StartCoroutine(SetMoveableObj(2)); } }
private void SetAndInstantietMoveableObj(ISpawnable spawnable, int ID) { switch (ID) { case 1: selectedMoveableObj = spawnable.SpawnAtPoint(selectedMoveableObjPos); break; case 2: unSelectedMoveableObj = spawnable.SpawnAtPoint(unSelectedMoveableObjPos); break; } }
public void UnSelecctSuperBubble() { if (this.superBubble != null) { this.superBubble.Hide(true); } selectedMoveableObj.Hide(false); unSelectedMoveableObj.Hide(false); shootingSuperBubble = false; superBubble.DestroyMoveableObj(); superBubble = null; }
public void SwapBubble() { selectedMoveableObj.ChangePosition(unSelectedMoveableObjPos, transform.position, true); unSelectedMoveableObj.ChangePosition(selectedMoveableObjPos, transform.position, false); IMoveableAndHideable temp = null; temp = selectedMoveableObj; selectedMoveableObj = unSelectedMoveableObj; unSelectedMoveableObj = temp; lastSelectedTag = unSelectedMoveableObj.GetTag(); }
public void SelectSuperBubble(ISpawnable superBubble) { if (shootingSuperBubble == false) { if (this.superBubble != null) { this.superBubble.Hide(false); } // Debug.Log("called"); selectedMoveableObj.Hide(true); unSelectedMoveableObj.Hide(true); shootingSuperBubble = true; this.superBubble = superBubble.SpawnAtPoint(selectedMoveableObjPos); } }