I am following along with BergZergArcades great tutorial video here trying to learn how to add items to the editor menus and how to set up an item database. Everything seems to be running great and working as expected except this code keeps having an issue with the get.
whole code…
using UnityEditor;
using UnityEngine;
using System.Linq; //needed for ElementAt
using System.Collections;
using System.Collections.Generic;
namespace SylvirGamerz.ItemSystem
{
public class ISQualityDatabase : ScriptableObject
{
[SerializeField]
List<ISQuality> database = new List<ISQuality>();
public void Add(ISQuality item)
{
database.Add(item);
EditorUtility.SetDirty(this);
}
public void Insert(int index, ISQuality item)
{
database.Insert(index, item);
EditorUtility.SetDirty(this);
}
public void Remove(ISQuality item)
{
database.Remove(item);
EditorUtility.SetDirty(this);
}
public void Remove(int index)
{
database.RemoveAt(index);
EditorUtility.SetDirty(this);
}
public int Count()
{
get { return database.Count; }
}
public ISQuality Get(int index)
{
return database.ElementAt(index);
}
public void Replace(int index, ISQuality item)
{
database[index] = item;
EditorUtility.SetDirty(this);
}
}
}
here is the specific issue areas…
public void Remove(int index)
{
database.RemoveAt(index);
EditorUtility.SetDirty(this);
}
public int Count()
{
get { return database.Count; }
}
public ISQuality Get(int index)
{
return database.ElementAt(index);
}
the get word is having issues in the Count function. I am not sure why this is causing an issue. any ideas? the editor is calling for a parsing error so i am pretty sure that i just mixed something up but the { i dont think is it as the video clearly shows it on the code.
link to the video. …
any help would be great thanks! great great video tutorial seris so far as well!