示例#1
0
        /// <summary>
        /// テクスチャファイルを設定
        /// </summary>
        /// <param name="graphic">グラフィック情報</param>
        public void LoadFile(AdvGraphicInfo graphic)
        {
            this.GraphicInfo = graphic;
            this.Loader.LoadGraphic(
                graphic, () =>
            {
                switch (graphic.FileType)
                {
                case AdvGraphicInfo.FileType2D:
                case "":
                    RawImage rawImage = ChangeGraphicComponent <RawImage>();
                    rawImage.texture  = graphic.File.Texture;
                    InitSize(new Vector2(rawImage.texture.width, rawImage.texture.height));
                    break;

                case AdvGraphicInfo.FileTypeDicing:
                    DicingImage dicingImage = ChangeGraphicComponent <DicingImage>();
                    dicingImage.DicingData  = graphic.File.UnityObject as DicingTextures;
                    string pattern          = graphic.SubFileName;
                    dicingImage.ChangePattern(pattern);
                    InitSize(new Vector2(dicingImage.PatternData.Width, dicingImage.PatternData.Height));
                    break;

                default:
                    Debug.LogError(graphic.FileType + " is not support ");
                    break;
                }
                OnLoadEnd.Invoke();
            });
        }
示例#2
0
    // Use this for initialization
    IEnumerator Start()
    {
        AssetBundleManager.Instance.Initialize("", 0);

        Debug.Log("TestDicingImage.Start");

        yield return(StartCoroutine(AssetBundleManager.Instance.LoadAssetBundle(assetbundle_name,
                                                                                (bool _bResult, string _strError) => {
            if (_bResult)
            {
                //masterChara.Load(AssetBundleManager.Instance.GetAsset<TextAsset>("master_data" , "master_chara.csv"));
                dicing_image.DicingData = AssetBundleManager.Instance.GetAsset <Utage.DicingTextures>(assetbundle_name, asset_name);

                dicing_image.ChangePattern(start_pattern);

                Debug.Log(AssetBundleManager.Instance.GetAsset <Utage.DicingTextures>("image/chara/anne", "image/chara/anne.asset"));
                Debug.Log(AssetBundleManager.Instance.GetAsset <Utage.DicingTextures>("image/chara/anne", "Assets/02texture/Dicing/Output1/Character/anne.asset"));
                Debug.Log(AssetBundleManager.Instance.GetAsset <Utage.DicingTextures>("image/chara/anne", "anne.asset"));
            }
            else
            {
                Debug.Log("fail");
            }
        }, (float progress, int fileNum, int fileIndex, bool isComplete, string error) =>
        {
        })));
    }
示例#3
0
        protected virtual void SetIconDicingPattern(AssetFile file, string pattern)
        {
            DicingImage    dicing        = ChangeIconComponent <DicingImage>();
            DicingTextures dicingTexture = file.UnityObject as DicingTextures;

            dicing.DicingData = dicingTexture;
            dicing.ChangePattern(pattern);
            dicing.UvRect = new Rect(0, 0, 1, 1);
            ChangeReference(file, dicing.gameObject);
        }
示例#4
0
        private void SetIconDicingPattern(AssetFile file, string pattern)
        {
            DicingImage    image       = this.ChangeIconComponent <DicingImage>();
            DicingTextures unityObject = file.UnityObject as DicingTextures;

            image.DicingData = unityObject;
            image.ChangePattern(pattern);
            image.UvRect = new Rect(0f, 0f, 1f, 1f);
            this.ChangeReference(file, image.get_gameObject());
        }
示例#5
0
        private void SetIconDicing(AdvGraphicInfo graphic, Rect rect)
        {
            DicingImage    image       = this.ChangeIconComponent <DicingImage>();
            DicingTextures unityObject = graphic.File.UnityObject as DicingTextures;
            string         subFileName = graphic.SubFileName;

            image.DicingData = unityObject;
            image.ChangePattern(subFileName);
            float width  = image.PatternData.Width;
            float height = image.PatternData.Height;

            image.UvRect = rect.ToUvRect(width, height);
            this.ChangeReference(graphic.File, image.get_gameObject());
        }
示例#6
0
        //ダイシングで表示する
        protected virtual void SetIconDicing(AdvGraphicInfo graphic, Rect rect)
        {
            DicingImage    dicing        = ChangeIconComponent <DicingImage>();
            DicingTextures dicingTexture = graphic.File.UnityObject as DicingTextures;
            string         pattern       = graphic.SubFileName;

            dicing.DicingData = dicingTexture;
            dicing.ChangePattern(pattern);

            float w = dicing.PatternData.Width;
            float h = dicing.PatternData.Height;

            dicing.UvRect = rect.ToUvRect(w, h);

            ChangeReference(graphic.File, dicing.gameObject);
        }