Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (!dc)
        {
            return;
        }
        var currentSwarmDepth = dc.GetSwarmDepthMeters();

        if (!started && currentSwarmDepth < triggerAtDepth)
        {
            return;
        }

        if (!started)
        {
            AudioController.Instance.PlaySound(warningAudioName);
        }

        started = true;

        var pos = transform.position;

        // Movement on cos curve?

        Vector3 diff = transform.up;

        Vector3 dir = new Vector3(0, verticalSpeed, 0);

        transform.position += (diff + dir) * Time.deltaTime * movementSpeed;

        outOfBounds();
    }