private void OnTriggerStay(Collider other) { if (isAlight) { RaycastHit hit; Physics.Raycast(transform.position, other.transform.position - transform.position, out hit); if (hit.collider != other) { return; } if (other.GetComponentInParent <Renderer>()) { if (fireManager.GetIfFlammable(other.GetComponentInParent <Renderer>().sharedMaterial)) { if (!other.GetComponentInChildren <FireSystem>()) { fireManager.AddFireSystem(other.gameObject); } else if (!other.GetComponent <MeshCollider>()) { BurnOther(other.GetComponentInChildren <FireSystem>()); } } } } }
protected virtual void OnTriggerStay(Collider other) { if (isAlight) { if (fireManager.GetIfFlammable(other.GetComponentInParent <Renderer>().sharedMaterial)) { if (!other.GetComponentInChildren <FireWithTemperatureAndFuel>()) { fireManager.AddFireSystem(other.gameObject); } else if (!other.GetComponent <MeshCollider>()) { SpreadTemperature(other.GetComponentInChildren <FireWithTemperatureAndFuel>()); } } } }