private void OnTriggerExit2D(Collider2D collision) { if (collision.tag == "Player") { fuelSystem = null; } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { fuelSystem = collision.GetComponent <FuelSystem>(); } }
private void Awake() { rb = GetComponent <Rigidbody2D>(); fuelSystem = GetComponent <FuelSystem>(); rb.velocity = new Vector2(startSpeed, 0); audioManager = GameObject.FindGameObjectWithTag("AudioController").transform.GetComponent <audioManager>(); flameSprite.enabled = false; }
private int angleLimitForAngularDeceleration = 4; // magic number that was selected in practical way private void Awake() { _rigidBody = GetComponent <Rigidbody2D>(); _transform = transform; if (fuelSystem == null) { fuelSystem = GetComponent <FuelSystem>(); } }
public static EnergySystem GetFuelSystem(Vehicle.VehicleType i_VehicleType) { fuelInformationLable(); EnergySystem energySystem = new FuelSystem( getAutomatedFuelType(i_VehicleType), getMaximumFuelAmount(i_VehicleType), getCurrentFuelAmount(getMaximumFuelAmount(i_VehicleType))); return(energySystem); }
// Start is called before the first frame update void Start() { inputManager = GetComponent <InputManager>(); rigidBody = GetComponent <Rigidbody>(); if (centerMass) { rigidBody.centerOfMass = centerMass.localPosition; } fuelSystem = GetComponent <FuelSystem>(); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Ship")) { FuelSystem fuelscript = collision.GetComponent <FuelSystem>(); if (GameManager.currentFuel < GameManager.maxFuel) { fuelscript.addFuel(15); } Destroy(transform.parent.gameObject); } }
/*public List<Bullet> Bullets * { * get * { * return bullets; * } * }*/ public Player(ChopperBase basicChopper, Vector2 position) { /*hitRadius = sprite.Texture.Width; * * if (hitRadius < sprite.Texture.Height) * { * hitRadius = sprite.Texture.Height; * } * hitRadius /= 2;*/ //this.sprite = sprite; /*chopperBase = ChopperList.GetChopper(0); * chopperBase.SnapCenter(position);*/ chopperBase = basicChopper; chopperBase.SnapCenter(position); //bullets = new List<Bullet>(); //this.weaponSystem = weaponSystem; alive = true; deathTimer = new Timer(3); landTimer = new Timer(2); fuelSystem = new FuelSystem(1000000, 1000000); ammoSystem = new AmmoSystem(1000, 1000); healthSystem = new HealthSystem(2000, 2000); effects = new List <EffectManager>(); /*fuelSystem = new FuelSystem(10000, 10000); * ammoSystem = new AmmoSystem(10, 10);*/ }
// Use this for initialization void Start() { rigidBody = GetComponent <Rigidbody>(); audSource = GetComponent <AudioSource>(); fuelSystem = GetComponent <FuelSystem>(); }
// Start is called before the first frame update void Start() { speed = Mathf.Clamp(speed, minSpeed, maxSpeed); fuelSystem = GetComponent <FuelSystem>(); }
private void Awake() { _instance = this; }
// Use this for initialization void Start() { fuelSystem = new FuelSystem (maxFuelValue); status = FuelStatus.Consume; }