// Use this for initialization
        void Start()
        {
            _rigidBody = GetComponent <Rigidbody2D>();
            _animator  = GetComponent <Animator>();
            _animator.SetFloat("Angle", 0f);

            _pickupOption = GetComponent <PickupOptionController>();
            _inventory    = GetComponent <InventoryController>();
            _equipment    = GetComponent <EquipmentController>();
            _stats        = GetComponent <AttributeController>();
            _airItem      = GetComponent <AirItemController>();

            _lastPosition = transform.position;
        }
        private void Awake()
        {
            GameObject player = GameObject.FindGameObjectWithTag(Constant.TAG_PLAYER);

            _playerEquipment = player.GetComponent <EquipmentController>();

            _slots = new List <EquipmentSlot>();
            for (int i = 0; i < _playerEquipment.EquipmentTable.Count; ++i)
            {
                GameObject slot = Instantiate(EquipmentSlotPrefab, EquipmentSlotParent);
                _slots.Add(slot.GetComponent <EquipmentSlot>());
                _slots[i].SetPosition(i);
            }
        }
Example #3
0
 public void OnUnequip(EquipmentController playerEquipment, AttributeController playerStats)
 {
     Debug.Log("Unequip " + Name);
     playerEquipment.RemoveItem(_equipmentType);
     UnapplyBuff(playerStats);
 }
Example #4
0
 public void OnEquip(EquipmentController playerEquipment, AttributeController playerStats)
 {
     Debug.Log("Equip " + Name);
     playerEquipment.AddItem(Copy());
     ApplyBuff(playerStats);
 }