// ------------------------------------------------------------------------ // Method: Awake // Description: Get the child and assign the item type // Find out which item this is using tag and switch statement // ------------------------------------------------------------------------ private void Awake() { _pickupMesh = transform.GetChild(0).gameObject; _pickupAudio = GetComponent <AudioSource>(); switch (transform.tag) { case TagsHashIDs.HandgunPickup: _thisItem = _itemType.Handgun; break; case TagsHashIDs.ShotgunPickup: _thisItem = _itemType.Shotgun; break; case TagsHashIDs.PlasmaRiflePickup: _thisItem = _itemType.PlasmaRifle; break; case TagsHashIDs.HealthPickup: _thisItem = _itemType.HealthPickup; break; case TagsHashIDs.AmmoPickup: _thisItem = _itemType.AmmoPickup; break; default: break; } }
public Sprite[] itemImage; // 이미지. 경우에 따라 2개 이상의 이미지가 필요(파티션 등) public ItemController(string _serialNumb, int _itemPrice, _itemType itemType, Sprite[] _itemImage) { serialNumb = _serialNumb; itemPrice = _itemPrice; this.itemType = itemType; itemImage = _itemImage; }
set => SetProperty(ref _itemType, value);