public static void Initial(Transform buff)
 {
     GameBuffer = new GameobjectBuffer(buff);
     GameBuffer.RegComponent(new ComponentInfo <Transform>()
     {
         loader = new TransfromLoader()
     });
     GameBuffer.RegComponent(new ComponentInfo <HImage>()
     {
         loader = new HImageLoader()
     });
     GameBuffer.RegComponent(new ComponentInfo <HText>()
     {
         loader = new HTextLoader()
     });
     GameBuffer.RegComponent(new ComponentInfo <UIElement>()
     {
         loader = new UIElementLoader()
     });
 }
Example #2
0
        /// <summary>
        /// 初始化UI组件,包含有:Transform,HImage,TextBox,HText,HLine,UIElement
        /// </summary>
        /// <param name="buff">回收站的父物体</param>
        public static void Initial(Transform buff)
        {
            GameBuffer = new GameobjectBuffer(buff);
            var transHleper = GameBuffer.RegFakeStructHelper <UITransfromData>();
            var imgHelper   = GameBuffer.RegFakeStructHelper <HImageData>();
            var txtHelper   = GameBuffer.RegFakeStructHelper <HTextData>();
            var graphHelper = GameBuffer.RegFakeStructHelper <HGraphicsData>();
            var eleHelper   = GameBuffer.RegFakeStructHelper <UIElementData>();

            GameBuffer.RegFakeStructHelper <TextInputData>();

            var transLoader = new UITransfromLoader();
            var imgLoader   = new HImageLoader()
            {
                ImageHelper = imgHelper, GraphicsHelper = graphHelper, ElementHelper = eleHelper
            };
            var txtLoader = new HTextLoader()
            {
                TextHelper = txtHelper, GraphicsHelper = graphHelper, ElementHelper = eleHelper
            };
            var grapLoader = new HGraphicsLoader()
            {
                GraphicsHelper = graphHelper, ElementHelper = eleHelper
            };
            var eleLoader = new UIElementLoader()
            {
                ElementHelper = eleHelper
            };

            GameBuffer.RegComponent(new ComponentInfo <Transform>()
            {
                loader = transLoader
            });
            GameBuffer.RegComponent(new ComponentInfo <HImage>()
            {
                loader = imgLoader
            });
            GameBuffer.RegComponent(new ComponentInfo <TextBox>()
            {
                loader = txtLoader
            });
            GameBuffer.RegComponent(new ComponentInfo <HText>()
            {
                loader = txtLoader
            });
            GameBuffer.RegComponent(new ComponentInfo <HLine>()
            {
                loader = grapLoader
            });
            GameBuffer.RegComponent(new ComponentInfo <UIElement>()
            {
                loader = eleLoader
            });
        }
Example #3
0
        public static void Initial(Transform buff)
        {
            GameBuffer = new GameobjectBuffer(buff);
            GameBuffer.RegComponent(new ComponentInfo <Transform>()
            {
                loader = new TransfromLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <SpriteRenderer>()
            {
                loader = new SpriteRenderLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <SpriteMask>()
            {
                loader = new SpriteMaskLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <BoxCollider2D>()
            {
                loader = new BoxColliderLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <CircleCollider2D>()
            {
                loader = new CircleColliderLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <PolygonCollider2D>()
            {
                loader = new PolygonColliderLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <EdgeCollider2D>()
            {
                loader = new EdgeColliderLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <CapsuleCollider2D>()
            {
                loader = new CapsuleColliderLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <CompositeCollider2D>()
            {
                loader = new CompositeColliderLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <Rigidbody2D>()
            {
                loader = new RigidbodyLoader()
            });

            GameBuffer.RegComponent(new ComponentInfo <AreaEffector2D>()
            {
                loader = new AreaEffectLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <BuoyancyEffector2D>()
            {
                loader = new BuoyancyLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <ConstantForce2D>()
            {
                loader = new ConstantForceLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <DistanceJoint2D>()
            {
                loader = new DistanceJointLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <FixedJoint2D>()
            {
                loader = new FixedJointLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <FrictionJoint2D>()
            {
                loader = new FrictionJointLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <HingeJoint2D>()
            {
                loader = new HingeJointLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <PlatformEffector2D>()
            {
                loader = new PlatformEffectorLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <PointEffector2D>()
            {
                loader = new PointEffectorLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <RelativeJoint2D>()
            {
                loader = new RelativeJointLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <SliderJoint2D>()
            {
                loader = new SliderJointLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <SpringJoint2D>()
            {
                loader = new SpringJointLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <SurfaceEffector2D>()
            {
                loader = new SurfaceEffectorLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <TargetJoint2D>()
            {
                loader = new TargetJointLoader()
            });
            GameBuffer.RegComponent(new ComponentInfo <WheelJoint2D>()
            {
                loader = new WheelJointLoader()
            });
        }