// Token: 0x06000AD6 RID: 2774 RVA: 0x0002EF14 File Offset: 0x0002D314
    private IEnumerator Capture()
    {
        string name = CaptureSceneDataEditor.Instance.pictureName;

        this.InitPicture(name);
        yield return(new WaitForEndOfFrame());

        CaptureScreenHelper.CaptureCameraEditor(name);
        yield return(null);

        SceneManager.LoadScene("CaptureStartEditor");
        yield break;
    }
    // Token: 0x06000A59 RID: 2649 RVA: 0x0002CC34 File Offset: 0x0002B034
    public static Texture2D CaptureCamera(string pictureName)
    {
        Camera    main      = Camera.main;
        float     y         = (float)(Screen.height - Screen.width) * 0.5f;
        Rect      source    = new Rect(0f, y, (float)Screen.width, (float)Screen.width);
        Texture2D texture2D = new Texture2D((int)source.width, (int)source.height, TextureFormat.RGB24, false);

        texture2D.ReadPixels(source, 0, 0, false);
        texture2D.Apply();
        TextureUtility.ScaleBilinear(texture2D, 256, 256);
        byte[] bytes     = texture2D.EncodeToPNG();
        string thumbPath = CaptureScreenHelper.GetThumbPath(pictureName);

        File.WriteAllBytes(thumbPath, bytes);
        return(texture2D);
    }
    // Token: 0x060009A9 RID: 2473 RVA: 0x00029AB4 File Offset: 0x00027EB4
    private IEnumerator FinishBack()
    {
        this._gamePanel.SetActive(false);
        this._overPanel.SetActive(true);
        GameManager.Instance.levelManager.MinZoom();
        yield return(new WaitForEndOfFrame());

        string    TID     = SceneGameManager.Instance.CurrentTID;
        Texture2D texture = CaptureScreenHelper.CaptureCamera(TID);

        ImagePoolManager.Instance.UpdateSprite(TID, texture);
        yield return(null);

        PlayerManager.Instance.SaveLevelData(TID);
        PlayerManager.Instance.SetFillColor(TID, GameManager.Instance.levelDataManager.tileFillColorList);
        base.StartCoroutine(this.OnFinishDelay());
        yield break;
    }
    // Token: 0x060009A5 RID: 2469 RVA: 0x00029A6C File Offset: 0x00027E6C
    private IEnumerator GameBack()
    {
        yield return(null);

        GameManager.Instance.levelManager.MinZoom();
        yield return(new WaitForEndOfFrame());

        string    TID     = SceneGameManager.Instance.CurrentTID;
        Texture2D texture = CaptureScreenHelper.CaptureCamera(TID);

        ImagePoolManager.Instance.UpdateSprite(TID, texture);
        yield return(null);

        PlayerManager.Instance.SaveLevelData(TID);
        PlayerManager.Instance.SetFillColor(TID, GameManager.Instance.levelDataManager.tileFillColorList);
        SceneGameManager.Instance.SwitchPanel(SceneGameManager.SCENEPANEL.MENU);
        yield break;
    }
示例#5
0
    // Token: 0x06000A28 RID: 2600 RVA: 0x0002BF70 File Offset: 0x0002A370
    private void LoadTexure(out Texture2D texture)
    {
        int width  = Screen.width;
        int width2 = Screen.width;

        texture = new Texture2D(width, width2);
        string thumbPath = CaptureScreenHelper.GetThumbPath(this._TID);

        if (!File.Exists(thumbPath))
        {
            texture = null;
            return;
        }
        FileStream fileStream = new FileStream(thumbPath, FileMode.Open, FileAccess.Read);

        fileStream.Seek(0L, SeekOrigin.Begin);
        byte[] array = new byte[fileStream.Length];
        fileStream.Read(array, 0, (int)fileStream.Length);
        fileStream.Close();
        fileStream.Dispose();
        texture.LoadImage(array);
    }
示例#6
0
    // Token: 0x06000A9C RID: 2716 RVA: 0x0002D964 File Offset: 0x0002BD64
    public static Texture2D LoadTextureByIO(string TID)
    {
        Texture2D texture2D = new Texture2D(0, 0);
        string    thumbPath = CaptureScreenHelper.GetThumbPath(TID);

        if (!File.Exists(thumbPath))
        {
            return(null);
        }
        FileStream fileStream = new FileStream(thumbPath, FileMode.Open, FileAccess.Read);

        fileStream.Seek(0L, SeekOrigin.Begin);
        byte[] array = new byte[fileStream.Length];
        fileStream.Read(array, 0, (int)fileStream.Length);
        fileStream.Close();
        fileStream.Dispose();
        int width  = Screen.width;
        int width2 = Screen.width;

        texture2D = new Texture2D(width, width2);
        texture2D.LoadImage(array);
        return(texture2D);
    }
    // Token: 0x0600089F RID: 2207 RVA: 0x0002523C File Offset: 0x0002363C
    private Sprite CreateSprite(string TID)
    {
        string    thumbPath = CaptureScreenHelper.GetThumbPath(TID);
        Texture2D texture2D;

        if (!File.Exists(thumbPath))
        {
            texture2D = (Texture2D)Resources.Load("Thumbs/Thumb_" + TID);
        }
        else
        {
            int width  = Screen.width;
            int width2 = Screen.width;
            texture2D = new Texture2D(width, width2);
            FileStream fileStream = new FileStream(thumbPath, FileMode.Open, FileAccess.Read);
            fileStream.Seek(0L, SeekOrigin.Begin);
            byte[] array = new byte[fileStream.Length];
            fileStream.Read(array, 0, (int)fileStream.Length);
            fileStream.Close();
            fileStream.Dispose();
            texture2D.LoadImage(array);
        }
        return(Sprite.Create(texture2D, new Rect(0f, 0f, (float)texture2D.width, (float)texture2D.height), new Vector2(0.5f, 0.5f)));
    }