Ejemplo n.º 1
0
    void LateUpdate()
    {
        Vector3 direction = GridMovement.GetDirectionFromInput();

        if ((clone = cloneAbility.GetClone()))            // intentional assignment

        {
            cloneMovement = clone.GetComponent <GridMovement> ();

            if (!movement.IsMoving() && !cloneMovement.IsMoving())
            {
                movement.MoveInDirection(direction);
                cloneMovement.MoveInDirection(direction);
            }
            else if (cloneMovement.isOnIce && !movement.IsMoving())
            {
                movement.MoveInDirection(direction);
            }
            else if (movement.isOnIce && !cloneMovement.IsMoving())
            {
                cloneMovement.MoveInDirection(direction);
            }
        }
        else if (movement.enabled)
        {
            movement.MoveInDirection(direction);
        }
    }