Exemplo n.º 1
0
    public void FillValues(int index, PlatformSettings platformInfo)
    {
        platformIndexText.text  = "#" + index;
        platformType.value      = (int)platformInfo.GetPlatformType();
        isMovable.isOn          = platformInfo.IsThePlatformMovable();
        directionToChange.value = (int)platformInfo.GetDirectionToChange();
        directionToMove.value   = (int)platformInfo.GetDirectionToMove();
        unitsToMove.value       = platformInfo.GetUnitsToMove() - 1; //1-3 to 0-2 Range conversion
        objectAttached.value    = (int)platformInfo.GetObjectAttached();

        UpdatePanels();
    }
Exemplo n.º 2
0
    public override void SetSettings(PlatformSettings ps)
    {
        settings = ps;

        unitsToMove     = ps.GetUnitsToMove();
        directionToMove = ps.GetDirectionToMove();
        speed           = GameManager.instance.GetCurrentSpeed();
        switch (unitsToMove)
        {
        case 2:
            speed = speed + (0.25f * speed);
            break;

        case 3:
            speed = speed + (0.75f * speed);
            break;
        }


        switch (directionToMove)
        {
        case Direction.Up:
            basePosition   = transform.position.x;
            targetPosition = basePosition + (unitsToMove * GameManager.instance.GetXOffset());
            break;

        case Direction.Down:
            basePosition   = transform.position.x;
            targetPosition = basePosition - (unitsToMove * GameManager.instance.GetXOffset());
            break;

        case Direction.Right:
            basePosition   = transform.position.z;
            targetPosition = basePosition - (unitsToMove * GameManager.instance.GetZOffset());
            break;

        case Direction.Left:
            basePosition   = transform.position.z;
            targetPosition = basePosition + (unitsToMove * GameManager.instance.GetZOffset());
            break;
        }

        initialPosition = transform.position;
        platformState   = PlatformState.Moving;
    }