I need to create a list that contains several variables within it, but I forgot how to do it. I used to do it a lot but I have not done it in a while and now I cannot get it working. I don’t think i am too far away from having it working correctly, but I cannot figure out what I am doing wrong.
using UnityEngine;
using System.Collections.Generic;
public class Structure : MonoBehaviour
{
[Header("Structure System")]
public List<BackGround> backgrounds = new List<BackGround>();
public List<Tile> tiles = new List<Tile>();
[Header("")]
public Vector2 offset;
}
public class BackGround : MonoBehaviour
{
[Header("Structure Background")]
public Vector2 backgroundPosition;
public Vector2 backgroundSize;
[Header("")]
public Material backgroundMaterial;
[HideInInspector]
public GameObject parent;
}
public class Tile : MonoBehaviour
{
[Header("Structure Tiles")]
public Vector2 tilePosition;
public Vector2 tileSize;
[Header("")]
public Material tileMaterial;
[HideInInspector]
public GameObject parent;
}