Example #1
0
    public void Awake()
    {
        mTrans     = transform;
        mRectTrans = GetComponent <RectTransform>();

        // 通过配置获取可显示的最大buff数量
        mBuffMaxCount = GameConstHelper.GetInt("GAME_BUFF_MAX_COUNT");
        if (mBuffMaxCount == 0)
        {
            mBuffMaxCount = 5;
        }

        mBuffWidgets = new BuffWidget[mBuffMaxCount];

        // 获取所有buff显示的控件
        for (int i = 0; i < mBuffMaxCount; ++i)
        {
            Transform trans = mTrans.Find(string.Format("Buff{0}", i));

            var buffWidget = new BuffWidget();
            buffWidget.WidgetObject = trans.gameObject;
            buffWidget.BuffImage    = trans.Find("BuffTex").GetComponent <RawImage>();

            mBuffWidgets[i] = buffWidget;
        }

        mBuffIds = new List <uint>();
    }
Example #2
0
    public override void Awake()
    {
        base.Awake();

        DrawFPS = false;

        var const_float_val = GameConstHelper.GetFloat("FPS_WAIT_TIME"); // fps检测的间隔时间

        if (const_float_val != 0)
        {
            FPSUpdateWaitTime = const_float_val;
        }

        var const_int_val = GameConstHelper.GetInt("FPS_MIN_LIMIT");

        if (const_int_val != 0)
        {
            mFpsMinLimit = const_int_val;
        }

        const_int_val = GameConstHelper.GetInt("FPS_NOTICE_INTERVALTIME");
        if (const_int_val != 0)
        {
            mFpsNoticeIntervalTime = const_int_val;
        }
    }
Example #3
0
            void Awake()
            {
                RED_POINT_DELTA_X = GameConstHelper.GetInt("HANDBOOK_RED_POINT_DELTA_X");
                RED_POINT_DELTA_Y = GameConstHelper.GetInt("HANDBOOK_RED_POINT_DELTA_Y");
                HANDBOOK_MIN_STAR = GameConstHelper.GetInt("HANDBOOK_MIN_STAR");
                if (handbookName == null)
                {
                    handbookName = this.transform.Find("Name").GetComponent <Text>();
                }
                if (handbookPicture == null)
                {
                    handbookPicture = this.transform.Find("Picture").GetComponent <RawImage>();
                }
                if (handbookBorder == null)
                {
                    handbookBorder = this.transform.Find("bg").GetComponent <Image>();
                }
                if (handbookInactiveMark == null)
                {
                    handbookInactiveMark = this.transform.Find("NotText").gameObject;
                }
                if (firstFiveStars == null || firstFiveStars.Count <= 0)
                {
                    firstFiveStars = new List <GameObject>();
                    var starParent1 = this.transform.Find("StarPanel");
                    for (int i = 0; i < starParent1.childCount; i++)
                    {
                        firstFiveStars.Add(starParent1.GetChild(i).gameObject);
                    }
                }
                if (moreThanFiveStars == null)
                {
                    moreThanFiveStars = this.transform.Find("StarPanel2/StarBg_1").gameObject;
                }
                if (moreThanFiveStarsCount == null)
                {
                    moreThanFiveStarsCount = this.transform.Find("StarPanel2/Text").GetComponent <Text>();
                }
                if (handbookFullMark == null)
                {
                    handbookFullMark = this.transform.Find("Max").gameObject;
                }
                if (handbookToggle == null)
                {
                    handbookToggle = this.transform.GetComponent <Toggle>();
                }
                if (handbookToggle != null)
                {
                    handbookToggle.onValueChanged.AddListener((isOn) =>
                    {
                        if (isOn)
                        {
                            OnHandBookItemClick?.Invoke(handbookID);
                        }
                    });
                }
                if (redPoint == null)
                {
                    redPoint        = this.gameObject.AddComponent <RedPoint>();
                    redPoint.DeltaX = RED_POINT_DELTA_X;
                    redPoint.DeltaY = RED_POINT_DELTA_Y;
                }

                //两个特效策划让对换一下
                if (activateEff == null)
                {
                    var trans = this.transform.Find("EF_UI_tujian_shengxing");
                    if (trans != null)
                    {
                        activateEff = trans.gameObject;
                    }
                }

                if (upgradeEff == null)
                {
                    var trans = this.transform.Find("EF_UI_tujian_jihuo");
                    if (trans != null)
                    {
                        upgradeEff = trans.gameObject;
                    }
                }

                Reset();
            }