示例#1
0
        protected override void OnValidate()
        {
            base.OnValidate();

            if (CanValidate() == false)
            {
                return;
            }

            // Update GameObject name
            if (overrideGameOjbectName == true)
            {
                gameObject.name = objectNamePrefix + uIElementName + UINameExtension;
            }

            // Find BFrame and BMenu in parents
            //parentBFrame = null;
            parentBFrame = GetComponentInParent <BFrame>();

            //BFrame newParentFrame = GetComponentInParent<BFrame>();
            //if (newParentFrame != this)
            //{
            //    parentBFrame = GetComponentInParent<BFrame>();
            //}


            parentBMenu = GetComponentInParent <BMenu>();
            //parentBMenu = null;
            //BMenu newparentMenu = GetComponentInParent<BMenu>();
            //if (newparentMenu != this)
            //{
            //    parentBMenu = GetComponentInParent<BMenu>();
            //}

            // Revalidate children UI Elements (only direct children. Revalidation will be propagated if they have revalidateAllDirectChildren set to true)
            if (revalidateAllDirectChildren)
            {
                for (int i = 0; i < transform.childCount; i++)
                {
                    if ((transform) &&
                        (transform.GetChild(i)) &&
                        (transform.GetChild(i).GetComponent <BUIElement>()))
                    {
                        if (propagateUINameToChildren)
                        {
                            transform.GetChild(i).GetComponent <BUIElement>().UIElementName = UIElementName;
                        }

                        transform.GetChild(i).GetComponent <BUIElement>().Revalidate();
                    }
                }
            }
        }
示例#2
0
        private void On_UI_FocusedFrameUpdated(BEHandle <BFrame> bEHandle)
        {
            BFrame bFrame = bEHandle.Arg1;

            if (cameraTransforms.ContainsKey(bFrame))
            {
                BFrameCameraTransform newCameraTransform = cameraTransforms[bFrame];
                cameraTransformLerp.StartValue   = lastCameraTransform.transform;
                cameraTransformLerp.EndValue     = newCameraTransform.transform;
                cameraTransformLerp.PlayDuration = newCameraTransform.TransitionTime;
                cameraTransformLerp.StartAnimation();

                lastCameraTransform = newCameraTransform;
            }
        }
示例#3
0
 public BFrameChildBMenu(BMenu bMenu, BFrame bFrame)
 {
     childBMenu      = bMenu;
     bFrameReference = bFrame;
 }