예제 #1
0
 private void Unequip(AbilityPartType partType)
 {
     if (HasPartOfType(partType))
     {
         GetEquippedPartOfType(partType).OnUneqipped();
     }
 }
예제 #2
0
    public AbilityPart GetEquippedPartOfType(AbilityPartType partType)
    {
        switch (partType)
        {
        case AbilityPartType.Behaviour:
            return(Behaviour);

        case AbilityPartType.Action:
            return(Action);

        default:
            throw new NotImplementedException();
        }
    }
    public void Change(AbilityPartType type)
    {
        ObjectSelectionPanel             panelInstance = Instantiate(panelPrefab, transform.root);
        IEnumerable <IObjectDescription> entries       = null;

        switch (type)
        {
        case AbilityPartType.Behaviour:
            entries = AbilityLoader.Behaviour;
            break;

        case AbilityPartType.Action:
            entries = AbilityLoader.Action;
            break;

        default:
            throw new System.NotImplementedException(type.ToString());
        }

        panelInstance.Initialize(entries, x =>
        {
            Ability.EquipPart((AbilityPart)x);
        });
    }
예제 #4
0
 private bool HasPartOfType(AbilityPartType type)
 {
     return(GetEquippedPartOfType(type) != null);
 }