예제 #1
0
    AudioSource audio;//odnośnik do dźwięku kolizji


    void Start()
    {
        audio = GetComponent <AudioSource>();


        //init ERF ACTOR
        ExternalExpert msiBallEmotionModel = ErfContext.GetInstance().FindExpert("MSIBallEmotionModel");

        playerModel = new CharacterModel();
        playerModel.RegisterExpert(msiBallEmotionModel);
        lastReportTime = DateTime.Now;


        rb = GetComponent <Rigidbody>();

        if (MainMenu.gameSettings == null)
        {
            //jeśli w debug initial screen był Game a nie Menu
            MainMenu.gameSettings          = new GameSettings();
            MainMenu.gameSettings.gameMode = GameMode.EMOTIONAL;
        }
        gameSettings = MainMenu.gameSettings;

        if (gameSettings.gameMode == GameMode.FIXED)//ustaw poziom trudności
        {
            setDifficultyEnum(gameSettings.gameDifficulty, false);
        }
        else
        {
            setDifficultyEnum(GameDifficulty.HARD, false);//ustaw na początek na poziom trudny w trybie rozpoznawania emocji
        }
    }
예제 #2
0
    // zaladowanie biblioteki erf do kontekstu
    void Awake()
    {
        // Debug.LogWarning("Ustawienia: "+MainMenu.gameSettings.gameMode.ToString()+" / "+MainMenu.gameSettings.gameDifficulty.ToString());
        ErfLogger.SetLoggingEnabled(true);
        ErfLogger.SetAllStreamsToLoggingFile(@"d://debug.txt");
        Debug.Log("Initializing ERF for ErfDemo, trying to load " + Directory.GetCurrentDirectory() + "\\MSIBallErf.dll");
        ErfContext context = ErfContext.GetInstance();

        testMSIBallErf();

        Debug.Log("Library successfully loaded");
    }
예제 #3
0
    void testMSIBallErf()
    {
        try {
            ExternalComponentLibrary library = ErfContext.GetInstance().LoadComponentLibrary("MSIBallErf.dll");
            if (library == null)
            {
                Debug.LogError("Could not load MSIBallErf library");
                return;
            }
        } catch (Exception e)
        {
            Debug.Log(e.Message);
            return;
        }
        //init:
        ExternalExpert msiBallEmotionModel = ErfContext.GetInstance().FindExpert("MSIBallEmotionModel");
        CharacterModel playerModel         = new CharacterModel();

        playerModel.RegisterExpert(msiBallEmotionModel);


        //collision:
        EecEvent timeElapsedEvent = new EecEvent((int)GameEvent.STD_TIME_ELAPSED);

        timeElapsedEvent.AddValue("NO_OF_COLLISIONS", Variant.Create(2));
        timeElapsedEvent.AddValue("CURRENT_SPEED", Variant.Create(7.0f));
        playerModel.HandleEvent(timeElapsedEvent);

        //odpowiedz z erf
        float fear = playerModel.GetEmotionVector().GetValue(OccEmotions.FEAR).AsFloat();

        //przeliczenie na poziom trudnosci
        if (fear > 0.0f)
        {
            Debug.Log("FIRST I WAS AFRAID, I WAS PETRIFIED!");
        }
        else
        {
            Debug.Log("I AM FEARLESS! I AM DEATH! I AM FIRE!");
        }
    }