예제 #1
0
        private void Update()
        {
            Vector3 player = gameObject.transform.position;

            if (toolCheck.CheckState() == "gun" && Input.GetMouseButtonDown(0))
            {
                Shoot();
            }
            else if (toolCheck.CheckState() != "gun" && Input.GetMouseButtonDown(0))
            {
                Debug.Log("Press Tab to Switch to gun");
            }
        }
예제 #2
0
 public override void Hit()
 {
     toolCheck = GameObject.FindGameObjectWithTag("Player").GetComponent <ToolSwitch>();
     if (toolCheck.CheckState() == "axe")
     {
         text.text = "";
         while (dropCount > 0)
         {
             dropCount--;
             Vector3 position = transform.position;
             position.x += spread * UnityEngine.Random.value - spread / 2;
             position.y += spread * UnityEngine.Random.value - spread / 2;
             GameObject go = Instantiate(pickUpDrop);
             go.transform.position = position;
         }
         Destroy(gameObject);
     }
     else if (toolCheck.CheckState() != "axe")
     {
         text.text = "Equip Axe To Break";
         return;
     }
 }