Example #1
0
 // Token: 0x06000439 RID: 1081 RVA: 0x0001CB2F File Offset: 0x0001AF2F
 public PictureCharaDataFormat(PictureCharaDataFormat original)
 {
     this.id       = original.id;
     this.name     = original.name;
     this.wayType  = original.wayType;
     this.posePath = original.posePath;
 }
Example #2
0
    // Token: 0x06000645 RID: 1605 RVA: 0x00024CE0 File Offset: 0x000230E0
    public Texture2D PictureCreate(int setId, int charaId, bool rndFix)
    {
        Texture2D texture2D                 = new Texture2D(500, 350, TextureFormat.RGB24, false);
        List <List <Texture2D> > list       = new List <List <Texture2D> >();
        List <List <Texture2D> > list2      = new List <List <Texture2D> >();
        Texture2D         texture2D2        = null;
        Texture2D         texture2D3        = null;
        PictureDataFormat pictureDataFormat = SuperGameMaster.sDataBase.get_PictureDB_forId(setId);

        if (rndFix)
        {
            pictureDataFormat.view = Vector2.zero;
        }
        List <PictureBackDataFormat> list3 = new List <PictureBackDataFormat>();

        foreach (string text in pictureDataFormat.backImage)
        {
            if (text == string.Empty)
            {
                list3.Add(new PictureBackDataFormat());
            }
            else
            {
                if (!pictureDataFormat.randomSet)
                {
                    list3.Add(SuperGameMaster.sDataBase.get_PictureBackDB_forName(text));
                }
                else
                {
                    int num = SuperGameMaster.sDataBase.search_PictureRandomDBIndex_forSet(text);
                    if (num != -1)
                    {
                        PictureRandomDataFormat pictureRandomDataFormat = SuperGameMaster.sDataBase.get_PictureRandomDB(num);
                        string name = pictureRandomDataFormat.setName[UnityEngine.Random.Range(0, pictureRandomDataFormat.setName.Length)];
                        list3.Add(SuperGameMaster.sDataBase.get_PictureBackDB_forName(name));
                    }
                    else
                    {
                        list3.Add(SuperGameMaster.sDataBase.get_PictureBackDB_forName(text));
                    }
                }
                if (rndFix)
                {
                    list3[list3.Count - 1].rndPos = new int[4];
                }
            }
        }
        List <PictureBackDataFormat> list4 = new List <PictureBackDataFormat>();

        foreach (string text2 in pictureDataFormat.frontImage)
        {
            if (text2 == string.Empty)
            {
                list4.Add(new PictureBackDataFormat());
            }
            else
            {
                if (!pictureDataFormat.randomSet)
                {
                    list4.Add(SuperGameMaster.sDataBase.get_PictureBackDB_forName(text2));
                }
                else
                {
                    int num2 = SuperGameMaster.sDataBase.search_PictureRandomDBIndex_forSet(text2);
                    if (num2 != -1)
                    {
                        PictureRandomDataFormat pictureRandomDataFormat2 = SuperGameMaster.sDataBase.get_PictureRandomDB(num2);
                        string name2 = pictureRandomDataFormat2.setName[UnityEngine.Random.Range(0, pictureRandomDataFormat2.setName.Length)];
                        list4.Add(SuperGameMaster.sDataBase.get_PictureBackDB_forName(name2));
                    }
                    else
                    {
                        list4.Add(SuperGameMaster.sDataBase.get_PictureBackDB_forName(text2));
                    }
                }
                if (rndFix)
                {
                    list4[list4.Count - 1].rndPos = new int[4];
                }
            }
        }
        PictureCharaDataFormat pictureCharaDataFormat  = SuperGameMaster.sDataBase.get_PictureCharaDB_forId(-1);
        PictureCharaDataFormat pictureCharaDataFormat2 = null;

        if (charaId != -1)
        {
            pictureCharaDataFormat2 = SuperGameMaster.sDataBase.get_PictureCharaDB_forId(charaId);
        }
        foreach (PictureBackDataFormat pictureBackDataFormat in list3)
        {
            List <Texture2D> list5 = new List <Texture2D>();
            if (pictureBackDataFormat.path == null)
            {
                list5.Add(null);
            }
            else
            {
                foreach (string path2 in pictureBackDataFormat.path)
                {
                    list5.Add(Resources.Load(path2) as Texture2D);
                }
            }
            list.Add(list5);
        }
        foreach (PictureBackDataFormat pictureBackDataFormat2 in list4)
        {
            List <Texture2D> list6 = new List <Texture2D>();
            if (pictureBackDataFormat2.path == null)
            {
                list6.Add(null);
            }
            else
            {
                foreach (string path4 in pictureBackDataFormat2.path)
                {
                    list6.Add(Resources.Load(path4) as Texture2D);
                }
            }
            list2.Add(list6);
        }
        bool flag = false;

        if (charaId == -1)
        {
            flag = true;
        }
        else if (pictureDataFormat.travelerPose[charaId] == string.Empty)
        {
            flag = true;
        }
        string text3 = string.Empty;

        if (flag)
        {
            text3 = pictureDataFormat.frogPose_s;
        }
        else
        {
            text3 = pictureDataFormat.frogPose;
        }
        int num3;

        if (!pictureDataFormat.randomSet)
        {
            num3 = SuperGameMaster.sDataBase.search_PictureCharaDB_posePathIndex_forPoseName(text3);
        }
        else
        {
            int num4 = SuperGameMaster.sDataBase.search_PictureRandomDBIndex_forSet(text3);
            if (num4 != -1)
            {
                PictureRandomDataFormat pictureRandomDataFormat3 = SuperGameMaster.sDataBase.get_PictureRandomDB(num4);
                string poseName = pictureRandomDataFormat3.setName[UnityEngine.Random.Range(0, pictureRandomDataFormat3.setName.Length)];
                num3 = SuperGameMaster.sDataBase.search_PictureCharaDB_posePathIndex_forPoseName(poseName);
            }
            else
            {
                num3 = -1;
            }
        }
        if (num3 != -1)
        {
            texture2D2 = (Resources.Load(pictureCharaDataFormat.posePath[num3]) as Texture2D);
        }
        num3 = -1;
        if (charaId != -1)
        {
            if (!pictureDataFormat.randomSet)
            {
                num3 = SuperGameMaster.sDataBase.search_PictureCharaDB_posePathIndex_forPoseName(pictureDataFormat.travelerPose[charaId]);
            }
            else
            {
                int num5 = SuperGameMaster.sDataBase.search_PictureRandomDBIndex_forSet(pictureDataFormat.travelerPose[charaId]);
                if (num5 != -1)
                {
                    PictureRandomDataFormat pictureRandomDataFormat4 = SuperGameMaster.sDataBase.get_PictureRandomDB(num5);
                    string poseName2 = pictureRandomDataFormat4.setName[UnityEngine.Random.Range(0, pictureRandomDataFormat4.setName.Length)];
                    num3 = SuperGameMaster.sDataBase.search_PictureCharaDB_posePathIndex_forPoseName(poseName2);
                }
                else
                {
                    num3 = -1;
                }
            }
        }
        if (num3 != -1 && pictureCharaDataFormat2 != null)
        {
            texture2D3 = (Resources.Load(pictureCharaDataFormat2.posePath[num3]) as Texture2D);
        }
        this.photo_frame = (Resources.Load("Picture/photo_frame") as Texture2D);
        if (pictureDataFormat.view != Vector2.zero)
        {
            int num6 = UnityEngine.Random.Range(0, (int)pictureDataFormat.view.x + 1);
            if (UnityEngine.Random.Range(0, 2) == 1)
            {
                num6 *= -1;
            }
            int num7 = UnityEngine.Random.Range(0, (int)pictureDataFormat.view.y + 1);
            if (UnityEngine.Random.Range(0, 2) == 1)
            {
                num7 *= -1;
            }
            pictureDataFormat.view = new Vector2((float)num6, (float)num7);
        }
        for (int m = 0; m < list.Count; m++)
        {
            if (list[m] != null)
            {
                this.SetTexture(texture2D, list[m], this.GetPivotPos(texture2D, list[m], list3[m].fixPos + pictureDataFormat.view, PictureCreator.Pivot.Center, list3[m].rndPos));
            }
        }
        if (charaId != -1)
        {
            if (pictureDataFormat.travelerPose[charaId] != string.Empty)
            {
                if (!pictureDataFormat.priority)
                {
                    this.SetTexture(texture2D, texture2D2, this.GetPivotPos(texture2D, texture2D2, pictureDataFormat.frogPos + pictureDataFormat.view, PictureCreator.Pivot.Center));
                    this.SetTexture(texture2D, texture2D3, this.GetPivotPos(texture2D, texture2D3, pictureDataFormat.travelerPos[charaId] + pictureDataFormat.view, PictureCreator.Pivot.Center));
                }
                else
                {
                    this.SetTexture(texture2D, texture2D3, this.GetPivotPos(texture2D, texture2D3, pictureDataFormat.travelerPos[charaId] + pictureDataFormat.view, PictureCreator.Pivot.Center));
                    this.SetTexture(texture2D, texture2D2, this.GetPivotPos(texture2D, texture2D2, pictureDataFormat.frogPos + pictureDataFormat.view, PictureCreator.Pivot.Center));
                }
            }
            else if (pictureDataFormat.frogPose_s != string.Empty)
            {
                this.SetTexture(texture2D, texture2D2, this.GetPivotPos(texture2D, texture2D2, pictureDataFormat.frogPos_s + pictureDataFormat.view, PictureCreator.Pivot.Center));
            }
            else
            {
                this.SetTexture(texture2D, texture2D2, this.GetPivotPos(texture2D, texture2D2, pictureDataFormat.frogPos + pictureDataFormat.view, PictureCreator.Pivot.Center));
            }
        }
        else if (pictureDataFormat.frogPose_s != string.Empty)
        {
            this.SetTexture(texture2D, texture2D2, this.GetPivotPos(texture2D, texture2D2, pictureDataFormat.frogPos_s + pictureDataFormat.view, PictureCreator.Pivot.Center));
        }
        else
        {
            this.SetTexture(texture2D, texture2D2, this.GetPivotPos(texture2D, texture2D2, pictureDataFormat.frogPos + pictureDataFormat.view, PictureCreator.Pivot.Center));
        }
        for (int n = 0; n < list2.Count; n++)
        {
            if (list2[n] != null)
            {
                this.SetTexture(texture2D, list2[n], this.GetPivotPos(texture2D, list2[n], list4[n].fixPos + pictureDataFormat.view, PictureCreator.Pivot.Center, list4[n].rndPos));
            }
        }
        this.SetTexture(texture2D, this.photo_frame, new Vector2(texture2D.texelSize.x / 2f, texture2D.texelSize.y / 2f));
        Debug.Log(string.Concat(new object[]
        {
            "[PictureCreator] 写真データ取得:setID = ",
            setId,
            " / charaId = ",
            charaId
        }));
        texture2D.Apply();
        return(texture2D);
    }