Пример #1
0
        private void OnEnable()
        {
            this.bloodBar = target as SuperBloodBar;
            selfRect      = bloodBar.GetComponent <RectTransform>();

            transitionTimeProp  = serializedObject.FindProperty("transitionTimeScaler");
            transitionImageProp = serializedObject.FindProperty("transitionImage");
            if (transitionImageProp.objectReferenceValue == null)
            {
                transitionImageProp.objectReferenceValue = GetComponentFromTransform <Image>(bloodBar.transform, "Transition");
            }

            transitionColorProp = serializedObject.FindProperty("transitionColor");
            fillImageProp       = serializedObject.FindProperty("fillImage");
            if (fillImageProp.objectReferenceValue == null)
            {
                fillImageProp.objectReferenceValue = GetComponentFromTransform <Image>(bloodBar.transform, "Fill");
            }
            fillColorProp       = serializedObject.FindProperty("fillColor");
            backGroundImageProp = serializedObject.FindProperty("backGroundImage");
            if (backGroundImageProp.objectReferenceValue == null)
            {
                backGroundImageProp.objectReferenceValue =
                    GetComponentFromTransform <Image>(bloodBar.transform, "BackGround");
            }
            backGroundColorProp = serializedObject.FindProperty("backGroundColor");
            maxValueProp        = serializedObject.FindProperty("maxValue");
            valueProp           = serializedObject.FindProperty("value");
            onValueChangeProp   = serializedObject.FindProperty("onValueChange");
        }
Пример #2
0
        partial void OnLoad()
        {
            //do any thing you want
            var trans_bloodBar = GetTransform("Image_PlayerStateBar/BloodBar");

            this.bloodBar  = trans_bloodBar.GetComponent <SuperBloodBar>();
            this.bloodText = trans_bloodBar.Find("Number").GetComponent <Text>();
            Assert.IsTrue(this.bloodBar && bloodText);

            var trans_expBar = GetTransform("Image_PlayerStateBar/ExpBar");

            this.ExpBar  = trans_expBar.GetComponent <SuperBloodBar>();
            this.expText = trans_expBar.Find("Number").GetComponent <Text>();
            Assert.IsTrue(this.ExpBar && expText);

            var trans_dragBar = GetTransform("Image_PlayerStateBar/DragBar");

            this.dragBar  = trans_dragBar.GetComponent <SuperBloodBar>();
            this.dragText = trans_dragBar.Find("Number").GetComponent <Text>();
            Assert.IsTrue(this.dragBar && dragText);

            this.moneyText = GetComponent <TextMeshProUGUI>("Image_MoneyBk/Tmp_Money");
            Assert.IsTrue(moneyText);
            this.rankText = GetComponent <Text>("Image_PlayerStateBar/Text_Rank");
            Assert.IsTrue(this.rankText);
        }
 public override void OnInstanciateObject()
 {
     base.OnInstanciateObject();
     Assert.IsTrue(HeadUi);
     headBloodBar = HeadUi.GetComponent <SuperBloodBar>("SuperBloodBar");
     Assert.IsTrue(headBloodBar);
 }