UnityVR游乐园笔记#002
跟着课程做的一个项目(VR游乐园)
1. 主场景的搭建
1-1. 场景背景

1-2. 头盔和手柄
摄像机要调整到10000

2. 创建UI界面(World Space)


3. 实现轮播图
创建 ImageItem 预制体

用代码生成 ImageItem
挂载在空对象
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class ImageItemCreaty : MonoBehaviour
{
public static ImageItemCreaty instance;
[HideInInspector]
public int i;
public Material[] materials;
public GameObject imageItem;
private float angle;
private void Awake()
{
instance = this;
}
private void Start()
{
angle = 360.0f / materials.Length;
for (int i = 0; i < materials.Length; i++)
{
GameObject go = Instantiate(imageItem, transform);
go.transform.localEulerAngles = new
Unity VR 游乐园:主场景与轮播图实现

本文记录了使用Unity和C#进行VR游乐园项目的实践过程,包括主场景的搭建,设置场景背景和头盔手柄,创建World Space的UI界面,实现轮播图功能,以及轮播图中视频播放的细节操作,如代码生成ImageItem,挂载Canvas,以及在切换轮播图时的视频播放控制。
最低0.47元/天 解锁文章
2593

被折叠的 条评论
为什么被折叠?



