コード例 #1
0
 private void Start()
 {
     MG = GetComponent <Item.MeleeGun>();
     if (MG == null)
     {
         G = GetComponent <Item.Gun>();
     }
 }
コード例 #2
0
 public void GetTarget(Transform T)
 {
     if (T == null)
     {
         Debug.Log("Should not happen?"); return;
     }
     G = T.GetComponent <Item.Gun>();
     //EX.ExtendPercent(0);
     //Debug.Log("changing targets to "+T.gameObject.name);
 }
コード例 #3
0
ファイル: StatusUI.cs プロジェクト: Notnyna/skeleton-codename
 private void Inv_OnChange(Transform item, int index, bool removed)
 {
     if (item == null)
     {
         item = Inv.GetInventory()[index];
         if (item == null)
         {
             ABar.SetActive(false); return;
         }
         Item.Gun G = item.GetComponent <Item.Gun>();
         if (G == null)
         {
             ABar.SetActive(false); return;
         }
         else
         {
             ABar.SetActive(true);
             ABar.GetComponent <AmmoBar>().GetTarget(item);
         }
     }
 }
コード例 #4
0
ファイル: Player.cs プロジェクト: Notnyna/skeleton-codename
 private void DoButtonAction()
 {
     if (OnActivate != null)
     {
         OnActivate(Camera.main.ScreenToWorldPoint(Input.mousePosition));
     }
     if (H.HeldItem != null)
     {
         Item.MeleeGun MG = H.HeldItem.GetComponent <Item.MeleeGun>();
         if (MG != null)
         {
             MG.Fire();
         }
         else
         {
             Item.Gun G = H.HeldItem.GetComponent <Item.Gun>();
             if (G != null)
             {
                 G.Fire(GetComponent <Rigidbody2D>().velocity);
             }
         }
     } // I dont like this, I want it the other way around!
 }