Exemplo n.º 1
0
    //通用组件
    public void InitCommomAbility(BasicEntity entity)
    {
        //增加ability组件
        AbilityComponent ability = (AbilityComponent)entity.AddComponent(ComponentType.Ability);

        ability.m_residentAbility.Add(ComponentType.State);
        ability.m_residentAbility.Add(ComponentType.Dead);
        ability.m_residentAbility.Add(ComponentType.Hide);
        ability.m_residentAbility.Add(ComponentType.UI);
    }
Exemplo n.º 2
0
    //增加临时组件
    public bool AddTemporaryComponent(BasicEntity entity)
    {
        AbilityComponent ability = entity.GetComponent <AbilityComponent> ();

        if (ability == null)
        {
            return(false);
        }
        foreach (ComponentType c in ability.m_temporaryAbility)
        {
            entity.AddComponent(c);
        }
        return(true);
    }