Coder Social home page Coder Social logo

roll-a-ball-swift's Introduction

roll-a-ball-swift

Unity's Roll-A-Ball tutorial implemented in Swift

Requirements:

  • Unity 5.4.0f3 to run the project
  • RemObjects Fire 8.4.96.2033 (beta) to modify source and game logic DLL

Overview

The project leverages Unity's support for managed plugins. This allows usage of DLLs generated by external compilers. To create a DLL, the project uses the RemObjects Elements compiler and their Swift implementation, Silver.

Since Assets/Plugins/GameLogic.dll is provided in the repo, you should be able to just run the Unity project as is. I only tested on macOS and iOS however. For iOS, the game builds but there is no touch input implemented.

In addition to the standard Unity project directories, the GameLogicSolution solution includes GameLogic and UnityAspect projects.

GameLogic Project

The GameLogic project implements the game logic. Similar to Roll-a-ball-FSharp, the source is a direct translation of the tutorial's C# to Swift. Also, the source is in one file since it's so trivial.

UnityAspect Project

The UnityAspect project uses Element's support for Aspects. It exposes an attribute that will publicize a Swift class property's underlying field for the Unity editor. This is necessary because Swift properties translate to properties, but Unity editor seems to work with serialized fields. In order to edit a property in the Unity editor, you will need to add the @UnityAspect.PublicizeField attribute to it.

Caveats

RemObjects provides an optional Swift Base Library.

It provides some of the core types, classes and functions that, while not part of the Swift language spec per se, are commonly used in Swift apps (and provided in a similar Swift Base Library in Apple's implementation).

Unfortunately, it requires .NET 4.0 which Unity does not use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.