void Start() { // Get the components for the Motor and Data data = GetComponent<ShipData>(); engine = GetComponent<ShipEngine>(); shooter = GetComponent<ShipShooter>(); }
public override void DenyPower() { ShipShooter shooter = ship.GetComponent <ShipShooter>(); shooter.activeWeapon = (int)ShipShooter.Weapons.Default; base.DenyPower(); }
private void Awake() { mover = GetComponent <ShipMover>(); shooter = GetComponent <ShipShooter>(); health = gameObject.GetComponent <TakeDamage>(); powerupManager = GetComponent <PowerupManager>(); forwardMoveSpeed = maxSpeed; }
public override void GrantPower() { ShipShooter shooter = ship.GetComponent <ShipShooter>(); int weaponChoice = Random.Range(1, (int)ShipShooter.Weapons.Count); shooter.activeWeapon = weaponChoice; base.GrantPower(); }
protected override void Start() { base.Start(); _gameManager.Player = this; _screenManager = ScreenManager.Instance; _shipShooterScript = GetComponent <ShipShooter>(); }
// Awake is called: // exactly once in the lifetime of the script (like Start). // upon GO activation or if a fn in any script attached to it is called. // even if the script is disabled // before any Start functions // after all GO's are initialized // USAGE: initialize any references, variables, or game state before the game starts. void Awake() { m_ShipShooter = FindObjectOfType <ShipShooter>(); // meh, there aren't many objects in the scene. }
// Awake is called: // exactly once in the lifetime of the script (like Start). // upon GO activation or if a fn in any script attached to it is called. // even if the script is disabled // before any Start functions // after all GO's are initialized // USAGE: initialize any references, variables, or game state before the game starts. void Awake() { m_ShipShooter = FindObjectOfType<ShipShooter>(); // meh, there aren't many objects in the scene. }
protected override void Start() { base.Start(); _shipShooterScript = GetComponent <ShipShooter>(); }