//Here we create the singleton that holds all the information for us to use. void Awake() { if (analyticsResults == null) { analyticsResults = this; } else if (analyticsResults != this) { Destroy(gameObject); } DontDestroyOnLoad(analyticsResults); }
void Start() { //Setting of above variables exitCollider = FindObjectOfType <LevelExitCollider>(); genComponent = GameObject.Find("LevelGenerator").GetComponent <Generator>(); uiGenComponent = GameObject.Find("Hand1").GetComponent <UIGenerator>(); uiGameObjects = uiGenComponent.comparisonGameObjectsGeneratorUI; bigCubeGameObjects = genComponent.comparisonGameObjectsGenerator; uiCubeParent = uiGenComponent.parentHolderUI; bigCubeParent = genComponent.parentHolder; doorGameObjects = FindObjectsOfType <Door>(); roomTypeindicators = FindObjectsOfType <RoomTypeindicator>(); levelAnalytics = FindObjectOfType <AnalyticsTestingClass>(); levelAnalytics = AnalyticsTestingClass.analyticsResults; //Find the objects that contain the scripts for analytics to work, then call levelstart to send analytics for funnel levelAnalytics.FindGameObjects(); RestartDoorSymbols(true, true); CheckDoors(); LevelStart(); }