예제 #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...");
        }
    }
예제 #2
0
    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();
    }