Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     audioSource      = gameObject.GetComponent <AudioSource>();
     audioSource.clip = fire1;
     ignitStatus      = gameObject.GetComponent <IgnitStatus>();
     changeStateFire  = 0;
 }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     ignitStatus = gameObject.GetComponent <IgnitStatus>();
     if (ignitStatus.GetIgnit() == false)
     {
         audioSource.Play();
     }
 }
Beispiel #3
0
    // 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);
                }
            }
        }
    }
Beispiel #4
0
 private void Start()
 {
     status = gameObject.GetComponent <IgnitStatus>();
 }