private void Awake() { Time.timeScale = 1f; playerControl = FindObjectOfType <PlayerControl>(); grapplingGun = playerControl.gameObject.GetComponentInChildren <GrapplingGun>(); pauseMenu = FindObjectOfType <PauseMenu>(); soundManager = FindObjectOfType <SoundManager>(); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
private void OnTriggerEnter(Collider other) { // If the player hits a level boundary, kill them. if (other.tag == "Player") { grapplingGun = FindObjectOfType <GrapplingGun>(); if (!grapplingGun.isGrapping()) { gameManager.KillPlayer(); } } }
void Awake() { physics = GetComponent <PlayerPhysics>(); controller = GetComponent <PlayerController>(); grapplingGun = GetComponent <GrapplingGun>(); attackbehaviour = GetComponent <AttackBehaviour>(); deadbehaviour = GetComponent <DeadBehaviour>(); physics.player = this; controller.physics = physics; controller.grapplingGun = grapplingGun; controller.attackBehaviour = attackbehaviour; controller.deadbehaviour = deadbehaviour; grapplingGun.physics = physics; attackbehaviour.physics = physics; }
private void Start() { grappling = (GrapplingGun)GetComponentInParent <WeaponTemplate>().altFire; }
// Start is called before the first frame update void Start() { gun = GameObject.FindGameObjectWithTag("Player").GetComponent <GrapplingGun>(); }
private void Awake() { this.rb = GetComponent <Rigidbody>(); this.grapplingGun = GetComponent <GrapplingGun>(); }
void LateStart() { gun1Access = GunComponent(gun1); gun2Access = GunComponent(gun2); }