Example #1
0
    void Update()
    {
        if (snakeParameters.SnakeHead == null)
        {
            return;
        }

        Move();
        Rotate();
        snakeParameters.ControlGlow(glow);
        transform.localScale = new Vector3(snakeParameters.referenceScale, snakeParameters.referenceScale, snakeParameters.referenceScale);
    }
Example #2
0
    private void Update()
    {
        if (snakeParameters.dieing)
        {
            return;
        }

        snakeParameters.ControlGlow(glow);
        transform.localScale = new Vector3(snakeParameters.referenceScale, snakeParameters.referenceScale, snakeParameters.referenceScale);

        Move();

        if (Vector3.Distance(transform.position, Vector3.zero) <= 500)
        {
            Rotate();
        }
        else
        {
            RotateTowardsCenter();
        }
    }