示例#1
0
 void Awake()
 {
     Interactable = GetComponent <XRGrabInteractable>();
     PlayerShip   = GameObject.Find("Ship");
     PlayerHealth = PlayerShip.GetComponent <PlayerLifes>();
     Effect.Play();
 }
示例#2
0
 // 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;
 }
示例#3
0
 public void CheckWeaponHit(PlayerLifes l_player)
 {
     if (!hasHit)
     {
         l_player.GetHit(c_WeaponDmg);
         hasHit = true;
         Debug.Log("Hit !");
     }
 }
示例#4
0
        void ReleaseDesignerOutlets()
        {
            if (Sensitivity != null)
            {
                Sensitivity.Dispose();
                Sensitivity = null;
            }

            if (PlayerLifes != null)
            {
                PlayerLifes.Dispose();
                PlayerLifes = null;
            }

            if (PlayerMunition != null)
            {
                PlayerMunition.Dispose();
                PlayerMunition = null;
            }
        }
示例#5
0
    // 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;
    }
示例#6
0
 // Use this for initialization
 void Awake()
 {
     player     = GameObject.FindWithTag("Player");
     _lifes     = player.GetComponent <PlayerLifes> ();
     playerLeft = false;
 }