- Home /
object assigns but does not show when added to list, or any other var
I built a custom class and called it. Then I tried to add it to a list. But the list shows that the element is "None (Spell Class)"
The debug log outputs the correct data for it even though it shows it not being there.
using UnityEngine; using System.Collections; using System.Collections.Generic;
public class PData : MonoBehaviour {
public List<SpellClass> OfSpells;
void Start ()
{
OfSpells = new List<SpellClass> ();
OfSpells.Add(new SpellClass());
Debug.Log (OfSpells [0].Output ()); }
}
To be honest I really have no idea why it is not working and would appreciate all the help I can get.
Comment
Your answer
Follow this Question
Related Questions
Can I choose what to pass into .getcomponent<{VARIABLE}>(); 1 Answer
How to sum a property of a class in a List 2 Answers
How can I make a list of Classes or Scripts? 3 Answers
class List adding to variables are assigning not adding 1 Answer
How to add a list as a variable within a list in code C# 1 Answer