Example #1
0
    protected GameObject AttackRangeSemiCircle02; //攻击范围 光效半圆环 循环

    public void SetBuildLife(BuildInfo Info, LifeProperty SkinProperty, LifeEnvironment Environment)
    {
        if (Info == null || SkinProperty == null)
        {
            return;
        }
        LifeProperty(SkinProperty);
        if (Info.m_Skill != null)
        {
            m_Skill = new BuildSkill(Info);
        }
        if (Environment == LifeEnvironment.Combat)
        {
            //初始化技能
            m_Attr   = new BuildAttribute(Info);
            m_Status = new Status();
            BuildColider bc = this.GetComponent <BuildColider>();
            if (bc != null && m_Attr.IsDamage)
            {
                bc.EnableBattleCollider(true);
            }
        }
        else
        {
            //HideHp();
            SetEditModeSetting(Info, Environment);
        }
    }
Example #2
0
    public virtual void InitBuild()
    {
        InitHP();
        HP = fullHP;

        SetSkin();
        //读取连击次数
        m_fAttackTickReady = 0;
        if (m_Skill != null)
        {
            BuildSkill skillBuild = m_Skill as BuildSkill;
            if (skillBuild.PropSkillInfo.m_attckmodeid > 0)
            {
                skillBuild.PropSkillInfo.GetAttackTimes(ref m_Attacktimes);
            }
            else
            {
                m_Attacktimes.Add(0.0f);
            }
        }
        m_nAttackCount = m_Attacktimes.Count;

        EventCenter.RegisterHooks(NDEventType.StatusCG, SetStatus);
        // -----buildingroom
        BuildColider bc = GetComponent <BuildColider>();

        if (bc != null)
        {
            bc.EnableBattleCollider(true);
        }
        BuildInfo info = CmCarbon.GetBuildInfo(this.m_Core.m_DataID);

        if (info != null)
        {
            ShowHP(info.BuildType, info.m_bear);
            m_roomType = info.m_RoomType;
        }
    }