Inheritance: MonoBehaviour
Example #1
0
	void Start () {
		
		beerPong = FindObjectOfType<BeerPong> ();
		gamePlay = FindObjectOfType<GameStateBehaviour> ();
		hoopRenderer = hoop.GetComponent<Renderer> ();
		thisRenderer = GetComponent <Renderer> ();
		thisCollider = GetComponent <Collider> ();
		hoopRenderer.material.color = onInvisibilityColor;
		offSetTime += Random.Range (0, 20f);
	}
Example #2
0
	void Awake () {

		beerPong = FindObjectOfType<BeerPong> ();
		gamePlay = FindObjectOfType<GameStateBehaviour> ();

		particleShader = Shader.Find ("Particles/Additive");
		defaultShader = obstacleRenderer.material.shader;
		baseColor = currentColor;
		currentColor = onInvisibilityColor;

		randomActivaitionOffset = Random.Range (0, 30);
		randomSpeedOffset = Random.Range (0.5f, 1f);

		StartCoroutine(ResetTransition());
	}
Example #3
0
 public void Awake()
 {
     beerPong       = FindObjectOfType(typeof(BeerPong)) as BeerPong;
     networkManager = GetComponent <BP_NetworkManager>();
 }
Example #4
0
 public void Awake()
 {
     beerPong = FindObjectOfType(typeof(BeerPong)) as BeerPong;
 }
Example #5
0
	void Awake () {

		throwDirection = Vector3.forward;
		Initialize <States> ();

		InvalidPlayerPositionText.SetActive (false);
		YouWonText.SetActive (false);
		YouLoseText.SetActive (false);
		PairingInfoText.SetActive (false);
		ReplayButton.SetActive (false);

		gameCameraTransform = GameObject.Find ("Tango AR Camera").transform;

		beerPongInstance = GetComponentInParent<BeerPong> ();
		beerPongInstance.ActivateGamePlay += HandleActivateGamePlay;

		ringBalls = new List<GameObject> ();
		obstacles = new List<GameObject> ();
	}
Example #6
0
	private bool DidClearCups (BeerPong.PlayerID playerID) {
		
		bool didClear = true;

		if (playerID == BeerPong.PlayerID.Second) {

			for (int i = 0; i < playerCupCount; i ++) {

				if (dictCup.ContainsKey (i)) {

					didClear = false;
					break;
				}
			}

		} else if (playerID == BeerPong.PlayerID.First) {
			
			for (int i = playerCupCount; i < 2*playerCupCount; i ++) {
				
				if (dictCup.ContainsKey (i)) {
					
					didClear = false;
					break;
				}
			}
		}

		return didClear;
	}
Example #7
0
	private void SetUpCamera (BeerPong.PlayerID playerID) {

		//Set the default roation, to reset roation on replay
		if (!didSetDefaultRotation) {
			
			beerPongTableDefaultRotation = BoardwalkPong.transform.rotation;
			didSetDefaultRotation = true;
		}

		if (playerID == BeerPong.PlayerID.Second) {

			//Change rotation as needed
			BoardwalkPong.transform.rotation = beerPongTableDefaultRotation;
			BoardwalkPong.transform.localRotation = Quaternion.Euler(BoardwalkPong.transform.localRotation.eulerAngles + Vector3.up * 180f);
		
		} else {
			
			//Change rotation as needed
			BoardwalkPong.transform.rotation = beerPongTableDefaultRotation;
		}
	}