コード例 #1
0
 void AssignInvWeaponManager()
 {
     if (wm == null)
     {
         wm = GameObject.FindGameObjectWithTag("WeaponManager").GetComponent <InvWeaponManager>();
     }
 }
コード例 #2
0
        public void AddAmmo(int amount)
        {
            //NOTE: the "SetWeaponId" must be called prior to this
            if (itemId == 9999999)
            {
                return;
            }
            InvWeaponManager invMg = GameObject.FindGameObjectWithTag("WeaponManager").GetComponent <InvWeaponManager>();

            invMg.AddAmmo(itemId, amount);
            itemId = 9999999;
        }
コード例 #3
0
 void Start()
 {
     gameManager = dontDestroy.currentGameManager;
     guiManager  = gameManager.GetComponent <GUIManager>();
     wm          = GameObject.FindGameObjectWithTag("WeaponManager").GetComponent <InvWeaponManager>();
 }