Exemplo n.º 1
0
        private void Awake()
        {
            GameObject player = GameObject.FindGameObjectWithTag(Constant.TAG_PLAYER);

            _playerStats = player.GetComponent <AttributeController>();

            _entries = new List <AttributeEntry>();
            for (int i = 0; i < _playerStats.AttributeTable.Count; ++i)
            {
                GameObject entry = Instantiate(AttributeEntryPrefab, AttributeEntryParent);
                _entries.Add(entry.GetComponent <AttributeEntry>());
            }
        }
Exemplo n.º 2
0
        // 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;
        }
Exemplo n.º 3
0
 public void OnConsume(InventoryController playerInventory, AttributeController playerStats, SlotPosition slotPosition)
 {
     Debug.Log("Consume " + Name);
     playerInventory.ConsumeItem(slotPosition);
     ApplyBuff(playerStats);
 }
Exemplo n.º 4
0
 public void OnUnequip(EquipmentController playerEquipment, AttributeController playerStats)
 {
     Debug.Log("Unequip " + Name);
     playerEquipment.RemoveItem(_equipmentType);
     UnapplyBuff(playerStats);
 }
Exemplo n.º 5
0
 public void OnEquip(EquipmentController playerEquipment, AttributeController playerStats)
 {
     Debug.Log("Equip " + Name);
     playerEquipment.AddItem(Copy());
     ApplyBuff(playerStats);
 }
Exemplo n.º 6
0
 public void OnUse(AttributeController playerStats, ItemObject itemObject)
 {
     Debug.Log("Use " + Name);
     ApplyBuff(playerStats);
     itemObject.DestroySelf();
 }
Exemplo n.º 7
0
 protected void UnapplyBuff(AttributeController playerStats)
 {
     Debug.Log("UnapplyBuff " + Name);
     playerStats.UnapplyBuff(_buffTable);
 }