void Awake() { Interactable = GetComponent <XRGrabInteractable>(); PlayerShip = GameObject.Find("Ship"); PlayerHealth = PlayerShip.GetComponent <PlayerLifes>(); Effect.Play(); }
// Use this for initialization void Awake() { //Find the player player = GameObject.FindWithTag("Player"); //Get his lifes _lifes = player.GetComponent <PlayerLifes> (); //Player is inside the boundary playerLeft = false; }
public void CheckWeaponHit(PlayerLifes l_player) { if (!hasHit) { l_player.GetHit(c_WeaponDmg); hasHit = true; Debug.Log("Hit !"); } }
void ReleaseDesignerOutlets() { if (Sensitivity != null) { Sensitivity.Dispose(); Sensitivity = null; } if (PlayerLifes != null) { PlayerLifes.Dispose(); PlayerLifes = null; } if (PlayerMunition != null) { PlayerMunition.Dispose(); PlayerMunition = null; } }
// Use this for initialization void Start() { //GET THE PLAYER GameObject playerObj = GameObject.FindWithTag("Player"); if (playerObj != null) { _playerlifes = playerObj.GetComponent <PlayerLifes> (); } hitAnim = hitAnim.GetComponent <Animator> (); hitSource = GetComponent <AudioSource> (); timeOut = 0.0f; waitTimeOut = 2f; shieldCapacity = 100; regenWarmUp = 5; regenAmount = 100; regenDuration = 50; color.x = shieldSprite.color.r; color.y = shieldSprite.color.g; color.z = shieldSprite.color.b; }
// Use this for initialization void Awake() { player = GameObject.FindWithTag("Player"); _lifes = player.GetComponent <PlayerLifes> (); playerLeft = false; }