// Update is called once per frame void Update() { //着火状態小炎 if (status.GetIgnit() && status.GetFireSize() == 1) { GetComponent <Renderer>().material = smallFireMat; if (!smallFireParticle.GetComponentInChildren <ParticleSystem>().isEmitting) { smallFireParticle.GetComponentInChildren <ParticleSystem>().Play(); fireParticle.GetComponentInChildren <ParticleSystem>().Stop(); bigFireParticle.GetComponentInChildren <ParticleSystem>().Stop(); } }//中炎 else if (status.GetIgnit() && status.GetFireSize() == 2) { GetComponent <Renderer>().material = fireMat; if (!fireParticle.GetComponentInChildren <ParticleSystem>().isEmitting) { fireParticle.GetComponentInChildren <ParticleSystem>().Play(); smallFireParticle.GetComponentInChildren <ParticleSystem>().Stop(); bigFireParticle.GetComponentInChildren <ParticleSystem>().Stop(); } }//大炎 else if (status.GetIgnit() && status.GetFireSize() == 3) { GetComponent <Renderer>().material = bigFireMat; if (!bigFireParticle.GetComponentInChildren <ParticleSystem>().isEmitting) { bigFireParticle.GetComponentInChildren <ParticleSystem>().Play(); fireParticle.GetComponentInChildren <ParticleSystem>().Stop(); smallFireParticle.GetComponentInChildren <ParticleSystem>().Stop(); } } //鎮火状態 else { GetComponent <Renderer>().material = normalMat; fireParticle.GetComponentInChildren <ParticleSystem>().Stop(); smallFireParticle.GetComponentInChildren <ParticleSystem>().Stop(); bigFireParticle.GetComponentInChildren <ParticleSystem>().Stop(); } //カーソルあってるとき if (status.GetCursol()) { GetComponent <Renderer>().material.color += cursolMat.color; status.SetCursol(false); } }
// Update is called once per frame void Update() { Ray ray = new Ray(); RaycastHit hit = new RaycastHit(); ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray.origin, ray.direction, out hit, Mathf.Infinity)) { GameObject obj = hit.collider.gameObject; if (obj.CompareTag(ignitTag)) { IgnitStatus status = obj.GetComponent <IgnitStatus>(); status.SetCursol(true); if (Input.GetMouseButtonDown(0) && status.GetFireSize() < MaxFireSize) { status.PlusFireSize(); concent.MinusConcentration(); } else if (Input.GetMouseButtonDown(1) && status.GetFireSize() != 0) { status.MinusFireSize(); concent.PlusConcentration(); } else if (Input.GetMouseButtonDown(2)) { for (int i = 0; i < status.GetFireSize(); i++) { concent.PlusConcentration(); } status.SetFireSize(0); } } } }