Пример #1
0
    void ShowBabyProperty()
    {
        if (Inst.GetIprop(PropertyType.PT_Free) == 0)
        {
            tuijian.gameObject.SetActive(false);
        }
        else
        {
            tuijian.gameObject.SetActive(true);
        }


        Shengyu.text = Inst.GetIprop(PropertyType.PT_Free).ToString();
        tili.text    = Inst.GetIprop(PropertyType.PT_Stama).ToString();
        liliang.text = Inst.GetIprop(PropertyType.PT_Strength).ToString();
        Qiangdu.text = Inst.GetIprop(PropertyType.PT_Power).ToString();
        sudu.text    = Inst.GetIprop(PropertyType.PT_Speed).ToString();
        mofa.text    = Inst.GetIprop(PropertyType.PT_Magic).ToString();

        accatkLabel.text            = Inst.GetIprop(PropertyType.PT_Attack).ToString();
        defensekLabel.text          = Inst.GetIprop(PropertyType.PT_Defense).ToString();
        agilitykLabel.text          = Inst.GetIprop(PropertyType.PT_Agile).ToString();
        spiritLabel.text            = Inst.GetIprop(PropertyType.PT_Spirit).ToString();
        replyLabel.text             = Inst.GetIprop(PropertyType.PT_Reply).ToString();
        slayLabel.text              = Inst.GetIprop(PropertyType.PT_Sex).ToString();
        hitLabel.text               = Inst.GetIprop(PropertyType.PT_Hit).ToString();
        counterattackLabel.text     = Inst.GetIprop(PropertyType.PT_counterpunch).ToString();
        dodgingLabel.text           = Inst.GetIprop(PropertyType.PT_Dodge).ToString();
        lethargyLabel.text          = Inst.GetIprop(PropertyType.PT_NoSleep).ToString();
        KangduLabel.text            = Inst.GetIprop(PropertyType.PT_NoPoison).ToString();
        AntidrunkLabel.text         = Inst.GetIprop(PropertyType.PT_NoDrunk).ToString();
        AntichaosLabel.text         = Inst.GetIprop(PropertyType.PT_NoChaos).ToString();
        AntiamnesticLabel.text      = Inst.GetIprop(PropertyType.PT_NoForget).ToString();
        AntiPetrochemicalLabel.text = Inst.GetIprop(PropertyType.PT_NoPetrifaction).ToString();


        if (Inst.GetIprop(PropertyType.PT_Free) == 0)
        {
            tuijian.gameObject.SetActive(false);
        }
        else
        {
            tuijian.gameObject.SetActive(true);
        }
        for (int i = 0; i < Attributes.Count; i++)
        {
            if (i == BabyData.StrongestAttribute(Inst.GetIprop(PropertyType.PT_TableId)))
            {
                tuijian.transform.position = new Vector3(tuijian.transform.position.x, Attributes[i].transform.position.y, tuijian.transform.position.z);
            }
        }
    }
Пример #2
0
    void Start()
    {
        InitUIText();
        UpdateUI();
        BabyProperty = UpdateUI;
        Attributes.Add(tili);
        Attributes.Add(liliang);
        Attributes.Add(Qiangdu);
        Attributes.Add(sudu);
        Attributes.Add(mofa);

        GamePlayer.Instance.babyUpdateIpropEvent += new RequestEventHandler <int>(UpdateUI);
        if (Inst != null)
        {
            if (Inst.GetIprop(PropertyType.PT_Free) == 0)
            {
                tuijian.gameObject.SetActive(false);
            }
            else
            {
                tuijian.gameObject.SetActive(true);
            }
            for (int i = 0; i < Attributes.Count; i++)
            {
                if (i == BabyData.StrongestAttribute(Inst.GetIprop(PropertyType.PT_TableId)))
                {
                    tuijian.transform.position = new Vector3(tuijian.transform.position.x, Attributes[i].transform.position.y, tuijian.transform.position.z);
                }
            }
        }
        else
        {
            tuijian.gameObject.SetActive(false);
        }


        jiaBtns.Add(tiliJa, PropertyType.PT_Stama);
        jiaBtns.Add(liliangJa, PropertyType.PT_Strength);
        jiaBtns.Add(QiangduJa, PropertyType.PT_Power);
        jiaBtns.Add(suduJa, PropertyType.PT_Speed);
        jiaBtns.Add(mofaJa, PropertyType.PT_Magic);

        jianBtns.Add(tiliJan, PropertyType.PT_Stama);
        jianBtns.Add(liliangJan, PropertyType.PT_Strength);
        jianBtns.Add(QiangduJan, PropertyType.PT_Power);
        jianBtns.Add(suduJan, PropertyType.PT_Speed);
        jianBtns.Add(mofaJan, PropertyType.PT_Magic);


        foreach (UIButton bt in jiaBtns.Keys)
        {
            UIEventListener.Get(bt.gameObject).onPress = myonPress;
        }
        foreach (UIButton bt in jianBtns.Keys)
        {
            UIEventListener.Get(bt.gameObject).onPress = myonPressJian;
        }

        UIManager.SetButtonEventHandler(queding.gameObject, EnumButtonEvent.OnClick, OnClickqueding, 0, 0);

        UIManager.SetButtonEventHandler(tiliJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Stama, 0);
//		UIManager.SetButtonEventHandler (tiliJa.gameObject, EnumButtonEvent.TouchDown, OnClickTouchDown, (int)PropertyType.PT_Stama, 0);

        UIManager.SetButtonEventHandler(tiliJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Stama, 0);

        UIManager.SetButtonEventHandler(liliangJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Strength, 0);
        UIManager.SetButtonEventHandler(liliangJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Strength, 0);

        UIManager.SetButtonEventHandler(QiangduJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Power, 0);
        UIManager.SetButtonEventHandler(QiangduJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Power, 0);

        UIManager.SetButtonEventHandler(suduJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Speed, 0);
        UIManager.SetButtonEventHandler(suduJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Speed, 0);

        UIManager.SetButtonEventHandler(mofaJa.gameObject, EnumButtonEvent.OnClick, OnClicktiliJa, (int)PropertyType.PT_Magic, 0);
        UIManager.SetButtonEventHandler(mofaJan.gameObject, EnumButtonEvent.OnClick, OnClictiliJan, (int)PropertyType.PT_Magic, 0);

        //UIManager.SetButtonEventHandler (GrowingUpBtn.gameObject, EnumButtonEvent.OnClick, OnClickGrowingUp,0, 0);
        queding.gameObject.SetActive(false);

        UIManager.SetButtonEventHandler(shuxingBtn.gameObject, EnumButtonEvent.OnClick, OnClickshuxingBtn, 0, 0);
        UIManager.SetButtonEventHandler(shuxingClose.gameObject, EnumButtonEvent.OnClick, OnClickshuxingClose, 0, 0);

        GuideManager.Instance.RegistGuideAim(propertyContainer, GuideAimType.GAT_MainBabyPropertyContainer);
        GuideManager.Instance.RegistGuideAim(queding.gameObject, GuideAimType.GAT_MainBabyPropertyConfirm);

        GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_BabyUIPropertySwitch);
        if (GlobalValue.isBattleScene(StageMgr.Scene_name))
        {
            SetattackBtnState(false);
        }
    }