Example #1
0
    public override void SetSettings(PlatformSettings ps)
    {
        settings = ps;

        newDirection = ps.GetDirectionToChange();

        switch (newDirection)
        {
        case Direction.Up:
            orientation = 0;
            break;

        case Direction.Down:
            orientation = 180;
            break;

        case Direction.Right:
            orientation = 90;
            break;

        case Direction.Left:
            orientation = -90;
            break;
        }
        this.gameObject.transform.eulerAngles = new Vector3(0, orientation, 0);
        initialPosition = transform.position;
    }
Example #2
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();
    }