unity のc#を勉強中です。
下記のItemクラスのpublic Item(Type type, Sprite sprite)
関数では何を行っているのでしょうか?
ItemListクラスなど他のスクリプトにもitemがあるのですが、他のスクリプトで使うのに必要なのでしょうか?
どなたかご教示いただけないでしょうか。
よろしくお願い致します。
using System; using UnityEngine; [Serializable] public class Item { public enum Type { Cube, Ball, } public Type type; public Sprite sprite; public Item(Type type, Sprite sprite) { this.type = type; this.sprite = sprite; } }
using System.Collections; using System.Collections.Generic; using UnityEngine; [CreateAssetMenu] public class ItemList : ScriptableObject { public List<Item> itemList = new List<Item>(); }
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/01/21 06:49 編集