private IEnumerator ShowObjectsWithPossessives() { SplitObjects(); //Get the audio context AudioContext3 audioContext = (AudioContext3)sceneManager.AudioContext; //Spawn VA_Male and half of the objects GameObject male = possessivesManager.ActivateObject("Male", Positions.MalePosition); //Set the AudioContext possessive audioContext.Possessive = Possessives.His; //Show objects and wait for the spawn to finish yield return(StartCoroutine(ShowObjectsWithContext(maleObjects))); sceneManager.DeactivateObject(male.gameObject.name); //Do the same for the female GameObject female = possessivesManager.ActivateObject("Female", Positions.FemalePosition); audioContext.Possessive = Possessives.Her; yield return(StartCoroutine(ShowObjectsWithContext(femaleObjects))); possessivesManager.DeactivateObject(female.gameObject.name); //Set the list of target fruits into the PossessivesManager possessivesManager.SetMaleObjects(maleObjects); possessivesManager.SetFemaleObjects(femaleObjects); //End the learning phase TriggerEvent(Triggers.LearningPhaseEnd); }
protected void CreateAllObjectsAndDisplayInRandomOrder() { //Shuffle the collection SceneObjects = AbstractSceneManager.Shuffle(SceneObjects); GameObject gameObj; //Define initial spawning position Vector3 startPosition = Positions.startPositionInlineFour; foreach (string obj in SceneObjects) { //Activate the object and attach to it the script for the task gameObj = possessivesManager.ActivateObject(obj, startPosition); SetFruitScripts(gameObj); startPosition += new Vector3(0.2f, 0, 0); } }