Пример #1
0
    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);
    }
Пример #2
0
    private void OnTriggerEnter(Collider otherCollider)
    {
        //If the collider belongs to a target fruit
        if (CheckIfInList(otherCollider.gameObject.name))
        {
            //Make the object disappear
            GameManager.DeactivateObject(otherCollider.gameObject.name);
            //Remove it from the list of target fruits
            fruitList.Remove(otherCollider.gameObject.name);
            //Trigger the positive reaction of the Virtual assistant
            EventManager.TriggerEvent(EventManager.Triggers.VAOk);
            Wait(3);
            //EventManager.TriggerEvent(EventManager.Triggers.PickedFruit);
            //If there are no more target fruits
            if (fruitList.Count == 0)
            {
                //Notify the Possessives Manager
                EventManager.TriggerEvent(EventManager.Triggers.BasketEmpty);
            }
        }
        else
        {
            //Trigger the negative reaction of the Virtual assistant
            EventManager.TriggerEvent(EventManager.Triggers.VAKo);
        }

        return;
    }