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; } } }
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; } }
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; } }
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>(); }