Error in Survival Shooter Tutorial can't find documentation to assist
I've been going through the unity tutorials recently and unfortunetly I have been stuck on this problem for about a week trying to figure it out on my own. Unfortunetly I can't find any documentation on the subject so I've come to the community to ask for assistance.
In the "ReadmeEditor" there is an error where "SessionState" can't be accessed due to it's protection level. This code came pre-packaged with the tutorial and I can't find any information on it outside the 2 lines it is used. It's grating on me because unity does not let me add new scripts to objects until errors have been resolved, so the entire tutorial has been stuck in deadlock for me.
Thank you anyone who offers help.
using UnityEditor;
using System;
using System.IO;
using System.Reflection;
[CustomEditor(typeof(Readme))]
[InitializeOnLoad]
public class ReadmeEditor : Editor {
static string kShowedReadmeSessionStateName = "ReadmeEditor.showedReadme";
static float kSpace = 16f;
static ReadmeEditor()
{
EditorApplication.delayCall += SelectReadmeAutomatically;
}
static void SelectReadmeAutomatically()
{
if (!SessionState.GetBool(kShowedReadmeSessionStateName, false )) //error here
{
var readme = SelectReadme();
SessionState.SetBool(kShowedReadmeSessionStateName, true); //error here
if (readme && !readme.loadedLayout)
{
LoadLayout();
readme.loadedLayout = true;
}
}
}
Answer by aley_DG · Jan 05 at 02:42 AM
I am having the same problem right now. Did you find any solution to this?