Example #1
0
		//public UILabel gemTotal;

		public override void Open(DotflowElement[] elements)
		{
			audioManager.menuFX [0].Play ();
			base.Open (elements);
			gemLabel.text = PlayerPrefs.GetInt("gemTotal").ToString();
			dotManager.isGameInProgress = true;
		}
Example #2
0
		//this is the base close function which tells elements to
		//exit the screen. it must be implemented in all classes
		//which inheret from DotflowMenu.
		public virtual void Close(DotflowElement[] elements)
		{
			foreach (DotflowElement element in elements) 
			{
				StartCoroutine(ExitScreen(element));
			}
		}
Example #3
0
		public override void Open(DotflowElement[] elements)
		{
			score.text = DotflowUIManager._dotManager.score.ToString ();
			base.Open (elements);
			dotManager.isGameInProgress = false;
			gemLabel.text = PlayerPrefs.GetInt ("gemTotal").ToString ();
		}
Example #4
0
		//this is the base open function which tells elements to
		//enter the screen. it must be implemented in all classes
		//which inheret from DotflowMenu.
		public virtual void Open(DotflowElement[] elements)
		{
			StopAllCoroutines ();
			foreach (DotflowElement element in elements) 
			{
				StartCoroutine(EnterScreen(element));
			}
		}
		//implemented from the base class
		public override void Close(DotflowElement[] elements)
		{
			base.Close (elements);
			foreach(GameObject go in gos)
			{
				go.transform.parent = lowerPanel.transform;
				go.GetComponent<BoosterItemBehavior>().selected = false;
			}
			lowerPanel.Reposition();
			currentBoostersSelected = 0;
		}
Example #6
0
		//this coroutine takes elements at whatever their current
		//location is and moves them to their pre-defined off screen
		//position. note that it does not disable those elements, it jsut
		//moves them off screen.
		private IEnumerator ExitScreen(DotflowElement element)
		{
			element.amIMoving = false;
			Vector3 currentPos = element.gameObject.transform.localPosition;

			//generates a random number to determine the speed of the element
			float randy = Random.Range (element.speedMin, element.speedMax);

			float timeElapsed = 0f;
			
			while(timeElapsed <= element.desiredTime)
			{
				element.transform.localPosition = Vector3.Lerp(currentPos, element.offScreenPosition, randy * timeElapsed);
				timeElapsed += Time.deltaTime;
				yield return new WaitForEndOfFrame();
			}
		}
Example #7
0
		//This coroutine takes a single dotflow element which has a
		//pre defined "start position" and "on screen position"
		//it will lerp from the start to the finish in order to bring
		//the elements from off screen to on screen as if they were
		//blown in from the side.
		private IEnumerator EnterScreen(DotflowElement element)
		{
			element.amIMoving = true;
			element.transform.position = element.startScreenPosition;
			element.gameObject.SetActive (true);

			//generates a random number to determine the speed of the element
			float randy = Random.Range (element.speedMin, element.speedMax);
			float timeElapsed = 0f;

			while(timeElapsed <= element.desiredTime || element.gameObject.transform.localPosition != element.onScreenPosition)
			{
				element.gameObject.SetActive (true);
				element.transform.localPosition = Vector3.Lerp(element.startScreenPosition, element.onScreenPosition, randy * timeElapsed);
				timeElapsed += Time.deltaTime;
				if(element.gameObject.transform.localPosition == element.onScreenPosition)  break;
				
				yield return new WaitForEndOfFrame();
			}
			element.amIMoving = false;
		}
Example #8
0
		public override void Close(DotflowElement[] elements)
		{
			base.Close (elements);

		}
Example #9
0
		public override void Open(DotflowElement[] elements)
		{
			base.Open (elements);
		}
Example #10
0
		public override void Close(DotflowElement[] elements)
		{
			audioManager.menuFX [0].Play ();
			base.Close (elements);
		}
		//implemented from the base class
		public override void Open(DotflowElement[] elements)
		{
			base.Open (elements);
			gemLabel.text = PlayerPrefs.GetInt("gemTotal").ToString();
		}