Unity3d实现翻书效果
此教程需要用到Book-Page Curl Pro插件,unity商店里有,需要插件和工程的话留邮箱
1、将插件中的bookPro复制成自己的prefab,将page0和page1提出来做prefab ,多余的page删掉,
并将RightPageShadow移出来并隐藏(这一步很重要);
适当把本来的0页与1页隐藏
2、写一个LoadBook的脚本挂上
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
public class LoadPage : MonoBehaviour
{
public GameObject pagePrefab0;
public GameObject pagePrefab1;
public GameObject MyBook;
public Sprite WhitePage;//如果页数是奇数的话加一张空白页
private BookPro bookPro;
private List<GameObject> pagePrefabsList;
//public GameObject image;
// 储存获取到的图片
List<Texture2D> textures = new List<Texture2D>();
List<Sprite> sprites = new List<Sprite&g