Beispiel #1
0
        public void Add(Item item)
        {
            item.SetActive(false);
            item.DisableRigidBody();
            item.transform.parent        = Main.Instance.Hand;
            item.transform.localPosition = Vector3.zero;
            item.transform.localRotation = Quaternion.Euler(Vector3.zero);

            if (item is AutoGunClip)
            {
                AutoGun a = Find <AutoGun>();
                a?.AddClip(item as AutoGunClip);
                return;
            }

            if (item is ShotGunClip)
            {
                ShotGun a = Find <ShotGun>();
                a?.AddClip(item as ShotGunClip);
                return;
            }

            _items.Add(item);
        }
Beispiel #2
0
 void Awake()
 {
     autoGun = transform.root.GetComponent <AutoGun>();
 }