示例#1
0
        //イメージデータから作成
        void MakeImageFromAvartorData(AvatarData data)
        {
            if (AvatarData == null)
            {
                return;
            }
            List <Sprite> parts = data.MakeSortedSprites(avatarPattern);

            foreach (var part in parts)
            {
                if (part == null)
                {
                    continue;
                }
                RectTransform child = RootChildren.AddChildGameObjectComponent <RectTransform>(part.name);
                child.gameObject.hideFlags = HideFlags.DontSave;
                Image image = child.gameObject.AddComponent <Image>();
                image.material = this.Material;
                image.sprite   = part;
                image.SetNativeSize();

                UguiFlip flip = image.gameObject.AddComponent <UguiFlip>();
                flip.FlipX = flipX;
                flip.FlipY = FlipY;
            }
        }
示例#2
0
        internal virtual void Flip(bool flipX, bool flipY)
        {
            UguiFlip component = base.GetComponent <UguiFlip>();

            if (component == null)
            {
                if (!flipX && !flipY)
                {
                    return;
                }
                component = base.get_gameObject().AddComponent <UguiFlip>();
            }
            component.FlipX = flipX;
            component.FlipY = flipY;
        }
示例#3
0
        //上下左右の反転
        internal virtual void Flip(bool flipX, bool flipY)
        {
            UguiFlip flip = this.GetComponent <UguiFlip>();

            //フリップ設定なし
            if (flip == null)
            {
                if (!flipX && !flipY)
                {
                    return;
                }
                flip = this.gameObject.AddComponent <UguiFlip>();
            }
            flip.FlipX = flipX;
            flip.FlipY = flipY;
        }
示例#4
0
        //上下左右の反転
        internal virtual void Flip(bool flipX, bool flipY)
        {
            if (!flipX && !flipY)
            {
                return;
            }
            UguiFlip flip = this.GetComponent <UguiFlip>();

            //フリップ設定を消してもう一度(順番が狂うので)
            if (flip != null)
            {
                flip.RemoveComponentMySelf();
            }
            flip       = this.gameObject.AddComponent <UguiFlip>();
            flip.FlipX = flipX;
            flip.FlipY = flipY;
        }