예제 #1
0
 private void FireControl()
 {
     if (Input.GetMouseButton(0) || Input.GetAxis("Fire1") > 0 || Input.GetAxis("Fire2") > 0 || Input.GetAxis("Fire3") > 0)
     {
         float currentTime = Time.time;
         if (currentTime - mFireBallTime < 0.3)
         {
             return;
         }
         mFireBallTime = currentTime;
         GameObject fireBall = (GameObject)Resources.Load("GamePrefabs\\FireBall");
         fireBall      = Instantiate(fireBall);
         fireBall.name = "fireBall";
         fireBall.transform.position = transform.position;
         FireBallControl fc = fireBall.GetComponent <FireBallControl>();
         if (fc != null)
         {
             fc.InitFireParameter(3.0f);
         }
     }
 }