Skip to content

Commit

Permalink
Added Unity demo app
Browse files Browse the repository at this point in the history
Unity+FyreVM demonstration application. Requires Unity.
  • Loading branch information
ChicagoDave committed Feb 5, 2015
1 parent 4c5ebd4 commit 3f582f9
Show file tree
Hide file tree
Showing 53 changed files with 12,718 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Unity/Inform/Extensions/HitPoint Studios/FyreVM Unity Support.i7x
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Version 1 of FyreVM Unity Support by HitPoint Studios begins here.

Include FyreVM Support by David Cornelson.

Every Turn (this is the FyreVM Unity Demo Support rule):
printLocationOutput;
continue the action.

When play ends:
printEndGameOutput;
continue the action.

The nTempNum is a number variable.
The nTempNum is 0.

The nRoom is a room that varies.

To printEndGameOutput:
[--output for the game ending]
select the EndGame channel;
say "GameEnded";
select the main channel.

To printLocationOutput:
[--output the location of the player]
select the Location channel;
Let zxcRoom be location of player;
say "[zxcRoom]";
select the main channel.

FyreVM Unity Support ends here.
13 changes: 13 additions & 0 deletions Unity/Inform/FyreVM Unity Demo.inform/Source/story.ni
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"FyreVM Unity Demo" by HitPoint Studios

Include FyreVM Unity Support by HitPoint Studios.

Redhall is a Room.
Bluehall is a Room.
Greenhall is a Room.

Redhall_Exit is a door.
The Redhall_Exit is north of the Redhall and south of the Bluehall.

Bluehall_Exit is a door.
The Bluehall_Exit is north of the Bluehall and south of the Greenhall.
47 changes: 47 additions & 0 deletions Unity/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# FyreVM Unity Integration Example

## Overview

This project is a basic example of integrating the FyreVM library into a Unity3D project. It illustrates basic interaction between Unity objects and FyreVM. The project was built using Unity version 4.6.2. The project may or may not work on earlier versions.

## Inform 7

### Building

Install the latest version of Inform 7 (http://inform7.com/download/).

Install the FyreVM Support extension found elsehwere in the FyreVM GitHub reporsitory.

FyreVM Support - handles the Channel IO communication protocols implemented in FyreVM.

Install the included Inform extension located under "Inform\Extensions" in this repository. These extensions include:

FyreVM Unity Support - handles the output of Unity-specific data into the apporpriate FyreVM channels.

To verify that the extensions are installed and working properly, open the 'FyreVM Unity Demo.inform' project in Inform and hit play. You should be able to navigate between the three rooms defined in the simple Inform script provided.

### Editing

To add extra functionality beyond the simple room navigation illustrated in this demo, you must add a new channel to the FyreVM Support extension and an output for that channel in the FyreVM Unity Support extension.

After adding any new functionality, make sure the settings are set to build a Glulx file and that "Bind up into a Blorb file on release" is not checked.

Select the Release option and it will generate a .ulx file for you.

Change the .ulx extension to .bytes and copy it over to the Unity folder: "\Unity\Assets\Resources\". This will allow unity to be able to read in the new Glulx file.

## Unity

### Building

Open up the Unity project located under "\Unity" in this repository using Unity 4.6.2 or later.

Press play in the editor and you should be able to navigate between the rooms defined in the Inform script.

### Editing

The scripts are located at "\Unity\Assets\Scripts\"

All of the glulx Channel IO processing is done via "GlulxStateService.cs"

To add new channel support, edit "eStateOutputChannels" in "GameConstants.cs" to include your new channels. Then add parsing logic to "GlulxStateService.ProcessGlulxOutput" to parse data from those new channels appropriately.
5 changes: 5 additions & 0 deletions Unity/Unity/Assets/Plugins.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Unity/Unity/Assets/Plugins/FyreVM.dll
Binary file not shown.
Binary file added Unity/Unity/Assets/Plugins/FyreVM.dll.mdb
Binary file not shown.
4 changes: 4 additions & 0 deletions Unity/Unity/Assets/Plugins/FyreVM.dll.mdb.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Unity/Unity/Assets/Plugins/FyreVM.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Unity/Unity/Assets/Plugins/FyreVM.pdb
Binary file not shown.
4 changes: 4 additions & 0 deletions Unity/Unity/Assets/Plugins/FyreVM.pdb.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Unity/Unity/Assets/Plugins/Newtonsoft.Json.dll
Binary file not shown.
7 changes: 7 additions & 0 deletions Unity/Unity/Assets/Plugins/Newtonsoft.Json.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3f582f9

Please sign in to comment.