Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     ability = player.ability;
     if (ability == PlayerController.Ability.gunfire && Input.GetMouseButtonDown(0))
     {
         Fire();
     }
 }
Exemplo n.º 2
0
    public void OnPointerEnter(PointerEventData eventData)
    {
        string name        = "";
        string description = "";

        if (Equipped == false)
        {
            Inventory.Item item = Inventory.Items[Index];
            if (item.type == Inventory.ItemType.ability)
            {
                PlayerController.Ability ability = PlayerController.AbilityInformation.abilities[item.id];
                name        = ability.name;
                description = ability.description;
            }
            else if (item.type == Inventory.ItemType.weapon)
            {
                PlayerController.Weapon weapon = PlayerController.WeaponInformation.weapons[item.id];
                name        = weapon.name;
                description = weapon.description;
            }
        }
        else
        {
            // If equipped, read from equipped items
            if (Type == Inventory.ItemType.ability)
            {
                PlayerController.Ability ability = PlayerController.Abilities[SlotNumber];
                name        = ability.name;
                description = ability.description;
            }
            else if (Type == Inventory.ItemType.weapon)
            {
                PlayerController.Weapon weapon = PlayerController.CurrentWeapon;
                name        = weapon.name;
                description = weapon.description;
            }
        }
        ItemInformation.SetDisplay(name, description);
    }
Exemplo n.º 3
0
 private void Start()
 {
     player  = GetComponent <PlayerController>();
     ability = player.ability;
 }