Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     mainCamera       = Camera.main;
     Cursor.visible   = false;
     Cursor.lockState = CursorLockMode.Locked;
     rayCastWeapon    = GetComponentInChildren <RayCastWeapon>();
 }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     maincamera       = Camera.main;
     Cursor.visible   = false;
     Cursor.lockState = CursorLockMode.Locked;
     weapon           = GetComponentInChildren <RayCastWeapon>();
     anim             = GetComponent <Animator>();
     audsource        = GetComponent <AudioSource>();
 }
Exemplo n.º 3
0
    void Start()
    {
        missile = GetComponent <ProjectileWeapon>();
        shotgun = GetComponent <RayCastWeapon>();

        shotgun.enabled      = true;
        missile.enabled      = false;
        shotgunImage.enabled = true;
        missileImage.enabled = false;
    }
 public void OnRaycastHit(RayCastWeapon weapon, Vector3 direction)
 {
     health.TakeDamage(weapon.damage, direction);
 }
Exemplo n.º 5
0
 private void Awake()
 {
     rayCastWeapon = GetComponent <RayCastWeapon>();
 }