複数枚の写真をマテリアルに適用したい。

実現したいこと

https://goodlucknetlife.com/unity-game-simple-rule/
を参考にし球体(多面体によるICO球をDL)にクリックしたら写真が変わるように複数枚の写真を取り込みたいです。
理想はGoogleストリートビューのような形です。

↓Materialsのインスペクターです。
イメージ説明

試したこと

参考サイトのコード9行目「private Image」を「private Materials」に変更すればできると思いました。

発生している問題・エラーメッセージ

エラーメッセージ cs(9,13): error CS0246: The type or namespace name 'Materials' could not be found (are you missing a using directive or an assembly reference?)

該当のソースコード

C#

using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;using UnityEngine.SceneManagement; public class Event : MonoBehaviour { private Materials RULEsphere; ** //error** public Sprite[] RULEsprite; int count; // Start is called before the first frame update void Start() { count = 0; RULEsphere = GetComponent<Materials>(); RULEsphere.sprite = RULEsprite[0]; } // Update is called once per frame void Update() { } public void TapDownUI() { switch (count) { case 0: RULEsphere.sprite = RULEsprite[1]; count++; break; case 1: RULEsphere.sprite = RULEsprite[2]; count++; break; case 2; break; } } }

補足情報(FW/ツールのバージョンなど)

Visual Studio 2019
Unity 2021.3.8f1

コメントを投稿

0 コメント