/// <summary>Create a new GameObject with a SkeletonGraphic component.</summary>
        /// <param name="material">Material for the canvas renderer to use. Usually, the default SkeletonGraphic material will work.</param>
        public static SkeletonGraphic NewSkeletonGraphicGameObject(SkeletonDataAsset skeletonDataAsset, Transform parent, Material material)
        {
            var sg = SkeletonGraphic.AddSkeletonGraphicComponent(new GameObject("New Spine GameObject"), skeletonDataAsset, material);

            if (parent != null)
            {
                sg.transform.SetParent(parent, false);
            }
            return(sg);
        }
Example #2
0
		public static SkeletonGraphic NewSkeletonGraphicGameObject (SkeletonDataAsset skeletonDataAsset, Transform parent) {
			SkeletonGraphic sg = SkeletonGraphic.AddSkeletonGraphicComponent(new GameObject("New Spine GameObject"), skeletonDataAsset);
			if (parent != null) sg.transform.SetParent(parent, false);
			return sg;
		}