Esempio n. 1
0
    void FindSpawnPoint()
    {
        Vector3 p = MMath.GetRandomPointInCircle(player.transform.position, SPAWNRADIUS);

        gameObject.transform.SetPosition(p);
        if (helper.CheckLights(gameObject))
        {
            gameObject.transform.SetPositionX(-10000);
            smc.SetState(respawning);
            Logger.Log("Monster4 could not spawn, respawning...");
        }
    }
    public void OnUpdate()
    {
        gameObject.transform.LookAt(stealth_player.transform.position);

        checkLightTimer++;
        if (checkLightTimer > 4)
        {
            if (smc.GetCurrentState() != panicking && helper.CheckLights(gameObject))
            {
                //we are in the light
                smc.SetState(panicking);
            }
            checkLightTimer = 0;
        }
        smc.Update();
    }