Exemple #1
0
    public virtual void Init()
    {
        if (m_info == null)
        {
            m_info = GetComponent <HeroInfo> ();
        }
        if (m_info != null)
        {
            m_info.Init(this);
        }
        if (m_strategy == null)
        {
            m_strategy = GetComponent <Strategy> ();
        }
        if (m_strategy != null)
        {
            m_strategy.Init(this);
        }
        if (m_move == null)
        {
            m_move = GetComponent <Move> ();
        }
        if (m_move != null)
        {
            m_move.Init(this);
        }
        if (m_attack == null)
        {
            m_attack = GetComponent <Attack> ();
        }
        if (m_attack != null)
        {
            m_attack.Init(this);
        }
        if (m_passive == null)
        {
            m_passive = GetComponent <Passive> ();
        }
        if (m_passive != null)
        {
            m_passive.Init(this);
        }
        if (m_heroAnim == null)
        {
            m_heroAnim = GetComponent <HeroAnim> ();
        }
        if (m_heroAnim != null)
        {
            m_heroAnim.Init(this);
        }

        GetHeroInfo().DeathFunc += delegate {
            TemBlock.isLock = false;
            TemBlock        = null;
        };
        m_IsInit = true;
    }