Пример #1
0
 void Start()
 {
     ObjectEventDispatcher.dispatcher.addEventListener(EventTypeName.DIU_FEIDAO, DiuFeidao);
     ObjectEventDispatcher.dispatcher.addEventListener(EventTypeName.DISTORY_FEIDAO, HasShouDao);
     if (!_uiskill)
     {
         _uiskill = GetComponent <UI_Skill>();
     }
     if (!_hzdate)
     {
         _hzdate = GetComponent <HZDate>();
     }
     if (!_player)
     {
         _player = GlobalTools.FindObjByName("player");
     }
     _uiskill.SetHZDate(_hzdate);
 }
Пример #2
0
    void GetInObj(Image img, string hz_ui_Name, HZDate hzDate, string hzPos)
    {
        //print("-------------->   "+objName);
        GameObject hz;

        //if(hz_ui_Name != "")
        //{

        //}
        hz = ObjectPools.GetInstance().SwpanObject2(Resources.Load(hz_ui_Name) as GameObject);
        //print("hz ---------------> "+ hz);
        //print("img-------------->  " + img);
        hz.transform.position = img.transform.position;
        hz.transform.parent   = this.transform; //GlobalTools.FindObjByName("PlayerUI").transform;
        hz.GetComponent <UI_Skill>().SetHZDate(hzDate);
        hz.GetComponent <UI_Skill>().SetSkillPos(hzPos);
        //print("hz   "+ hz+"   hz pos  "+hz.transform.position);
        HZList.Add(hz);
    }
Пример #3
0
    public virtual void SetHZDate(HZDate hzDate)
    {
        if (_hzDate != null)
        {
            return;
        }
        _hzDate = hzDate;
        //在这根据 信息 初始化
        SkillCanUseNums  = _hzDate.usenums;
        skillCanUseTimes = SkillCanUseNums;
        CDTimeNums       = _hzDate.cd;
        //print("CDTimeNums   "+ CDTimeNums+"   ----    "+ Intervals);
        GetComponent <TheTimer>().ContinuouslyTimesAdd(CDTimeNums, Intervals, CDCallBack);
        GetComponent <UIShake>().GetShakeObj(this.gameObject);
        //print("初始化 徽章的 技能信息!!!" + skillCanUseTimes);
        SetText(skillCanUseTimes.ToString());


        //查询 是够有 全局技能使用记录 有的话 从记录开始初始化   数据记录系统 优化
    }
Пример #4
0
    public bool IsHasHZHuo()
    {
        if (this.tag != GlobalTag.Player)
        {
            return(false);
        }
        HZDate huoren = GlobalTools.FindObjByName("PlayerUI").GetComponent <PlayerUI>().skill_bar.GetComponent <UI_ShowPanel>().IsHasHuoren();

        if (huoren != null)
        {
            if (lan >= huoren.xyLan)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        return(false);
    }
Пример #5
0
    public void ClickGetHZInformation(UEvent e)
    {
        HZDate _hzDate = e.eventParams as HZDate;

        HZ_information.text = _hzDate.GetHZ_information_str();
    }
Пример #6
0
    //float _CurrentBaojiBeishu = 0;

    //徽章的数据加成
    void GetHZDate(HZDate hzdate)
    {
        //print(hzdate.HZName);

        if (hzdate.def != 0)
        {
            this.def += hzdate.def;
        }
        if (hzdate.atk != 0)
        {
            this.atk += hzdate.atk;
        }
        if (hzdate.BaoJiLv != 0)
        {
            this.BaoJiLv += hzdate.BaoJiLv;
        }
        if (hzdate.BaoJiShangHaiBeiLv != 0)
        {
            if (this.BaoJiShangHaiBeiLv < hzdate.BaoJiShangHaiBeiLv)
            {
                this.BaoJiShangHaiBeiLv = hzdate.BaoJiShangHaiBeiLv;
                //_CurrentBaojiBeishu = this.BaoJiShangHaiBeiLv;
            }
        }

        if (hzdate.yingzhi != 0)
        {
            this.yingzhi += hzdate.yingzhi;
            csYZ          = yingzhi;
        }
        //print(this.atk + "  --   " + hzdate.atk);
        if (hzdate.live != 0)
        {
            //this.live = _live + hzdate.live;
            this.maxLive += hzdate.live;
            //print("装备最大气血装备  "+ this.maxLive);
            //ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.ADD_MAX_LIVE,maxLive), this);
        }

        if (hzdate.addLan != 0)
        {
            this.maxLan += hzdate.addLan;
        }

        if (hzdate.defP != 0)
        {
            beishuArr.Add("defP_" + hzdate.defP + "_" + hzdate.HZName);
        }
        if (hzdate.atkP != 0)
        {
            beishuArr.Add("atkP_" + hzdate.atkP + "_" + hzdate.HZName);
        }
        if (hzdate.liveP != 0)
        {
            beishuArr.Add("liveP_" + hzdate.liveP + "_" + hzdate.HZName);
        }

        if (hzdate.yingzhiP != 0)
        {
            beishuArr.Add("yingzhiP_" + hzdate.yingzhiP + "_" + hzdate.HZName);
        }


        //伤害减免比例的 使用
        if (hzdate.ShanghaiJianmianBili != 0)
        {
            if (hzdate.ShanghaiJianmianBili > this.shanghaijianmianLv)
            {
                this.shanghaijianmianLv = hzdate.ShanghaiJianmianBili;
            }
        }


        if (hzdate.KangDuJilv != 0)
        {
            KangDuJilv += hzdate.KangDuJilv;
        }
        if (hzdate.KangDuShanghaiJilv != 0)
        {
            KangDuShanghaijilv += hzdate.KangDuShanghaiJilv;
        }



        if (hzdate.KangHuoJilv != 0)
        {
            KangHuoJilv += hzdate.KangHuoJilv;
        }
        if (hzdate.KangHuoShanghaiJilv != 0)
        {
            KangHuoShanghaijilv += hzdate.KangHuoShanghaiJilv;
        }



        if (hzdate.KangDianJilv != 0)
        {
            KangDianJilv += hzdate.KangDianJilv;
        }
        if (hzdate.KangDianMabiJilv != 0)
        {
            KangDianMabiJilv = hzdate.KangDianMabiJilv;
        }
    }