예제 #1
0
 public static void ModifyContent(ref ImageRenderer renderer, Resource.IResource res)
 {
     renderer.rectTranfrom = renderer.GetComponent <RectTransform>();
     renderer.image        = renderer.GetComponent <RawImage>();
     renderer.ChangeContent(res);
     renderer.Attrs = res.Attrs;
     renderer.ApplyAttrs(res.Attrs);
 }
예제 #2
0
        public static ImageRenderer Generate(Resource.IResource res, Transform root)
        {
            GameObject obj    = new GameObject(res.Name);
            var        render = obj.AddComponent <ImageRenderer>();

            render.transform.parent = root;
            ModifyContent(ref render, res);
            return(render);
        }
예제 #3
0
 public abstract void ChangeContent(Resource.IResource contentData);
예제 #4
0
 public override void ChangeContent(Resource.IResource contentData)
 {
     image.texture = (Texture2D)((ImageResource)contentData).GetFile();
 }
예제 #5
0
 public override void ChangeContent(Resource.IResource contentData)
 {
     Content.text = (string)((TextResoure)contentData).GetFile();
 }