예제 #1
0
 void Update()
 {
     if (Input.GetKeyDown(Code_G))
     {
         //Debug.Log("G Pressed");
         if (slink.KeyGSkill != null)
         {
             ClickData cd = new ClickData();
             cd.Ksetdata(slink.KeyGSkill);
             theNW.AddClickData(cd);
             //Debug.Log("G Logged");
         }
     }
     if (Input.GetKeyDown(Code_C))
     {
         if (slink.KeyCSkill != null)
         {
             ClickData cd = new ClickData();
             cd.Ksetdata(slink.KeyCSkill);
             theNW.AddClickData(cd);
         }
     }
     if (Input.GetKeyDown(Code_R))
     {
         if (slink.KeyRSkill != null)
         {
             ClickData cd = new ClickData();
             cd.Ksetdata(slink.KeyRSkill);
             theNW.AddClickData(cd);
         }
     }
     if (Input.GetKeyDown(Code_T))
     {
         if (slink.KeyTSkill != null)
         {
             ClickData cd = new ClickData();
             cd.Ksetdata(slink.KeyTSkill);
             theNW.AddClickData(cd);
         }
     }
     if (Input.GetKeyDown(Code_F))
     {
         if (slink.KeyFSkill != null)
         {
             ClickData cd = new ClickData();
             cd.Ksetdata(slink.KeyFSkill);
             theNW.AddClickData(cd);
         }
     }
     if (Input.GetKeyDown(Code_D))
     {
         if (slink.KeyDSkill != null)
         {
             ClickData cd = new ClickData();
             cd.Ksetdata(slink.KeyDSkill);
             theNW.AddClickData(cd);
         }
     }
     if (Input.GetKeyDown(Code_E))
     {
         if (slink.KeyESkill != null)
         {
             ClickData cd = new ClickData();
             cd.Ksetdata(slink.KeyESkill);
             theNW.AddClickData(cd);
         }
     }
     if (Input.GetKeyDown(Code_Y))
     {
         if (slink.KeyYSkill != null)
         {
             ClickData cd = new ClickData();
             cd.Ksetdata(slink.KeyYSkill);
             theNW.AddClickData(cd);
         }
     }
     if (Input.GetKeyDown(Code_S))
     {
         ClickData cd = new ClickData();
         cd.Ksetdata(SkillCode.FireStop);
         theNW.AddClickData(cd);
     }
     if (Input.GetMouseButtonDown(0))
     {
         Vector2   mp = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         ClickData cd = new ClickData();
         if (Physics2D.OverlapPoint(mp) && Physics2D.OverlapPoint(mp).GetComponent <HPScript>() != null)
         {
             cd.Ssetdata(Physics2D.OverlapPoint(mp).gameObject.name);
         }
         else
         {
             cd.Msetdata(MButton.left, mp.x, mp.y); //Debug.Log("MButton Left Clicked X:" + mp.x);
         }
         theNW.AddClickData(cd);
     }
     if (Input.GetMouseButtonDown(1))
     {
         Vector2   mp = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         ClickData cd = new ClickData();
         cd.Msetdata(MButton.right, mp.x, mp.y);
         theNW.AddClickData(cd);
     }
 }