Exemple #1
0
    public void DamageCar(BaseCarMove carDamaged)
    {
        switch (damageType)
        {
        case DamageType.AllDamage: {
            carDamaged.AllDamage(damageValue, damageId);
            break;
        }

        case DamageType.PointDamage: {
            break;
        }

        case DamageType.Frost: {
            break;
        }

        case DamageType.Fire: {
            break;
        }

        case DamageType.Gravity: {
            break;
        }

        case DamageType.Lighting: {
            break;
        }
        }
    }
Exemple #2
0
    void OnTriggerEnter(Collider c)
    {
        BaseCarMove car = c.gameObject.transform.root.gameObject.GetComponentInChildren <BaseCarMove>();

        if (car != null && timer <= 0)
        {
            car.rigidbody.AddForce(direction * (boostForce * 10000));
            timer = 0.3f;
        }
    }
Exemple #3
0
    void OnCollisionEnter(Collision c)
    {
        BaseCarMove car = c.gameObject.transform.root.gameObject.GetComponentInChildren <BaseCarMove>();

        if (car != null && timer <= 0)
        {
            Debug.Log(c.gameObject.transform.root.gameObject.name);
            hazard.DamageCar(car);
            timer = 0.3f;
        }
    }
Exemple #4
0
    void OnTriggerEnter(Collider c)
    {
        BaseCarMove car = c.gameObject.transform.root.gameObject.GetComponentInChildren <BaseCarMove>();

        if (car != null && !waitingToSpawn)
        {
            car.weaponController.ChangeState(power);
            waitingToSpawn = true;
            gameArt[(int)power].SetActive(false);
        }
    }
 void Awake()
 {
     playerCar = GetComponent <BaseCarMove>();
 }