- Home /
Question by
Kekito · Nov 25, 2016 at 06:32 AM ·
scripting problemlisteditor-scriptingasset
Adding an element to List a .asset file of ScriptableObject
I created and asset file of this ScriptableObject:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace BuildingPrefabs
{
[SerializeField]
public class BuildingBlocksManager : ScriptableObject
{
[SerializeField]
public List<BuildingBlock> prefabsList = new List<BuildingBlock>();
}
public class BuildingBlock
{
[SerializeField]
public GameObject block;
[SerializeField]
public bool isActiveBlock;
public BuildingBlock() {
block = null;
isActiveBlock = false;
}
public BuildingBlock (GameObject block_, bool active = false)
{
block = block_;
isActiveBlock = active;
}
}
}
How do I add and element to the list in .asset file of this ScriptableObject?
Comment