Exemple #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>();
 }
Exemple #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>();
 }
Exemple #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);
 }
Exemple #5
0
 private void Awake()
 {
     rayCastWeapon = GetComponent <RayCastWeapon>();
 }