Exemplo n.º 1
0
    public override void Move()
    {
        if (prepareJump)
        {
            prepareJump = false;
            anim.SetTrigger("Jump");
        }

        if (onJump && pointsMove.Count > 0)
        {
            Vector2 temp = TWTransform.MoveTowardsWithParabola(transform.position, ref pointsMove, status.MOVEMENT_SPEED);
            transform.position = temp;
        }
    }
Exemplo n.º 2
0
    public override void PatrolTime()
    {
        if (onPatrol)
        {
            return;
        }

        currentTime += Time.deltaTime;
        if (currentTime > timeToNextPatrol)
        {
            onPatrol    = true;
            currentTime = 0;

            TWTransform.GetCurvePoints(ref pointsMove, transform.position, patrolPoints[currentPatrolIndex].position, maxHigh);
            currentPointsIndex = (int)Mathf.Floor(pointsMove.Count / 2f);
            NextPatrolIndex();
            prepareJump = true;
        }
    }