/// <summary> /// Get the value of the item inside this slot /// </summary> /// <returns></returns> public float GetCost() { float cost = 0; //avoid null exception if (current != null) { if (current.GetData() != null) { cost = current.GetData().cost; } } return(cost); }