Пример #1
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         fuelSystem = null;
     }
 }
Пример #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         fuelSystem = collision.GetComponent <FuelSystem>();
     }
 }
Пример #3
0
 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;
 }
Пример #4
0
    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>();
        }
    }
Пример #5
0
        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);
        }
Пример #6
0
    // 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>();
    }
Пример #7
0
    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);
        }
    }
Пример #8
0
        /*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);*/
        }
Пример #9
0
 // Use this for initialization
 void Start()
 {
     rigidBody  = GetComponent <Rigidbody>();
     audSource  = GetComponent <AudioSource>();
     fuelSystem = GetComponent <FuelSystem>();
 }
Пример #10
0
    // Start is called before the first frame update
    void Start()
    {
        speed = Mathf.Clamp(speed, minSpeed, maxSpeed);

        fuelSystem = GetComponent <FuelSystem>();
    }
Пример #11
0
 private void Awake()
 {
     _instance = this;
 }
Пример #12
0
 // Use this for initialization
 void Start()
 {
     fuelSystem = new FuelSystem (maxFuelValue);
     status = FuelStatus.Consume;
 }