

using UnityEngine;

/// <summary>
/// RoleEntity显示层处理
/// </summary>
public partial class RoleEntity
{
    protected RoleController m_rc;
    public RoleController rc => m_rc;
    
    protected Rigidbody m_Rigidbody;

    public Rigidbody Rigidbody => m_Rigidbody;
    
    protected WidgetMultiStateDispacher<BattleBuff> m_BuffDispacher;
    //protected WidgetStateDispacher m_ActionDispacher;
    
    protected virtual void InitView()
    {
        m_rc = GetComponentInChildren<RoleController>();
        
        m_Rigidbody = GetComponentInChildren<Rigidbody>(); // InitRigidBody();

        m_CapsuleCollider = GetComponentInChildren<CapsuleCollider>();

        m_BuffDispacher = new WidgetMultiStateDispacher<BattleBuff>(this);
        RegisterBuffProcessor(m_BuffDispacher);
        
        //m_ActionDispacher = new WidgetStateDispacher();
        //RegisterActionProcessor(m_ActionDispacher);
    }
    /*protected virtual void RegisterActionProcessor(WidgetStateDispacher dispacher)
    {
        
    }*/
    protected virtual void RegisterBuffProcessor(WidgetMultiStateDispacher<BattleBuff> dispacher)
    {
        
    }
    
    protected virtual void ViewUpdate()
    {
        /*if(curAction != null)
            m_ActionDispacher?.StateProcess(this,curAction.ID);*/
        
        m_BuffDispacher?.Process(buffs);

        
    }

  
    
    // void HitBack
}