예제 #1
0
        /// <summary>
        /// 対象のスキンパーツを生成
        /// </summary>
        /// <param name="rawImage">設定したいRawImage</param>
        /// <param name="texture2D">RawImageのTexture</param>
        /// <returns>生成したスキンパーツ</returns>
        public static SkinParts CreateSkinParts(RawImage rawImage, Texture2D texture2D)
        {
            var parts = new SkinParts();

            SkinnerUtility.ResetObjectReference(parts.property.objectReferenceValues, ObjectLength);
            parts.property.objectReferenceValues[RawImageIndex]  = rawImage;
            parts.property.objectReferenceValues[Texture2DIndex] = texture2D;
            return(parts);
        }
예제 #2
0
        /// <summary>
        /// 対象のスキンパーツを生成
        /// </summary>
        /// <param name="graphic">設定したいGraphic</param>
        /// <param name="material">GraphicのMaterial</param>
        /// <returns>生成したスキンパーツ</returns>
        public static SkinParts CreateSkinParts(Graphic graphic, Material material)
        {
            var parts = new SkinParts();

            SkinnerUtility.ResetObjectReference(parts.property.objectReferenceValues, ObjectLength);
            parts.property.objectReferenceValues[GraphicIndex]  = graphic;
            parts.property.objectReferenceValues[MaterialIndex] = material;
            return(parts);
        }
예제 #3
0
        /// <summary>
        /// 対象のスキンパーツを生成
        /// </summary>
        /// <param name="image">設定したいImage</param>
        /// <param name="sprite">ImageのSprite</param>
        /// <returns>生成したスキンパーツ</returns>
        public static SkinParts CreateSkinParts(Image image, Sprite sprite)
        {
            var parts = new SkinParts();

            SkinnerUtility.ResetObjectReference(parts.property.objectReferenceValues, ObjectLength);
            parts.property.objectReferenceValues[ImageIndex]  = image;
            parts.property.objectReferenceValues[SpriteIndex] = sprite;
            return(parts);
        }
예제 #4
0
        /// <summary>
        /// 対象のスキンパーツを生成
        /// </summary>
        /// <param name="rootGameObject">ルートとなるGameObject</param>
        /// <param name="animationClip">アニメーションクリップ</param>
        /// <param name="time">クリップをサンプルする時間</param>
        /// <returns>生成したスキンパーツ</returns>
        public static SkinParts CreateSkinParts(GameObject rootGameObject, AnimationClip animationClip, float time)
        {
            var parts = new SkinParts();

            SkinnerUtility.ResetObjectReference(parts.property.objectReferenceValues, ObjectLength);
            SkinnerUtility.ResetFloat(parts.property.floatValues, FloatLength);
            parts.property.objectReferenceValues[GameObjectIndex]    = rootGameObject;
            parts.property.objectReferenceValues[AnimationClipIndex] = animationClip;
            parts.property.floatValues[TimeIndex] = time;
            return(parts);
        }
예제 #5
0
        /// <summary>
        /// 対象のスキンパーツを生成
        /// </summary>
        /// <param name="userLogic">設定したいロジックのインスタンスオブジェクト</param>
        /// <param name="property">ロジックに合ったプロパティ</param>
        /// <returns>生成したスキンパーツ</returns>
        public static SkinParts CreateSkinParts(UserLogic userLogic, SkinPartsPropertry property)
        {
            var parts = new SkinParts();

            SkinnerUtility.ResetObjectReference(parts.property.objectReferenceValues, RequiredObjectLength);
            parts.property.objectReferenceValues[LogicIndex] = userLogic;
            parts.property.objectReferenceValues.AddRange(property.objectReferenceValues);
            parts.property.boolValues.AddRange(property.boolValues);
            parts.property.intValues.AddRange(property.intValues);
            parts.property.floatValues.AddRange(property.floatValues);
            parts.property.vector4Values.AddRange(property.vector4Values);
            return(parts);
        }