Exemplo n.º 1
0
    private void CheckStopped()
    {
        if (WPFMonoBehaviour.levelManager.gameState != LevelManager.GameState.Running)
        {
            return;
        }
        Vector3 position = base.transform.position;

        if (Vector3.Distance(position, this.m_stopTestPosition) > 0.1f)
        {
            this.m_stopTestPosition = position;
            this.m_stopTestTimer    = 0f;
        }
        else
        {
            this.m_stopTestTimer += Time.deltaTime;
            if (this.m_stopTestTimer > 5f)
            {
                EventManager.Send <PulseButtonEvent>(new PulseButtonEvent(UIEvent.Type.Building, true));
                this.m_replayPulseDone = true;
            }
        }
        if (this.m_checkCameraLimits)
        {
            LevelManager.CameraLimits currentCameraLimits = WPFMonoBehaviour.levelManager.CurrentCameraLimits;
            if (position.y < currentCameraLimits.topLeft.y - currentCameraLimits.size.y || position.x > currentCameraLimits.topLeft.x + currentCameraLimits.size.x * 1.1f || position.x < currentCameraLimits.topLeft.x - currentCameraLimits.size.x * 0.1f)
            {
                EventManager.Send <Pig.PigOutOfBounds>(new Pig.PigOutOfBounds());
            }
        }
    }
Exemplo n.º 2
0
    private void Update()
    {
        Vector3 position = base.transform.position;

        LevelManager.CameraLimits currentCameraLimits = WPFMonoBehaviour.levelManager.CurrentCameraLimits;
        if (position.x > currentCameraLimits.topLeft.x + currentCameraLimits.size.x * 1.1f || position.x < currentCameraLimits.topLeft.x - currentCameraLimits.size.x * 0.1f)
        {
            EventManager.Send <TimeBomb.BombOutOfBounds>(new TimeBomb.BombOutOfBounds());
        }
    }