// Trigger events - this basically collects th gun orb which allows the player get the power to use the gun private void OnTriggerEnter(Collider col) { GamerController mainGameController = GetGameController(); CharacterObject currentPlayer = mainGameController.GetCurrentCharacterProperties(); if (col.name.StartsWith("FlareMobile")) { currentPlayer.WeaponAllowed = true; mainGameController.UpdateHealth(currentPlayer, 20f); Destroy(col.gameObject); } }
public void OnVerAngChange(float val) { GamerController gameController = GameObject.FindWithTag("GameController").GetComponent <GamerController>(); GameObject currentCharacter = gameController.GetCurrentCharacterProperties().charObject; //change Grenade throw angle GameObject grenade = currentCharacter.transform.Find("Grenade").gameObject; grenade.transform.localEulerAngles = new Vector3(-45 * val, grenade.transform.localEulerAngles.y, grenade.transform.localEulerAngles.z); //Render arc currentCharacter.transform.Find("ProjectilePath").GetComponent <LaunchArcScript>().RenderArc(45 * val); }