Wednesday, 21 May 2014

Adding the Framework to an Existing Project: Unity Bootcamp.

The final part of my dissertation was to show how easy it is to integrate the Survival Framework into a new or existing project.  I choose an existing project from the Unity Store, called Bootcamp.  The Bootcamp project was created by Unity to showcase and outdoor environment with new lighting functions; I thought it would be apt to add my framework to this.

Integration was fairly easy and took 5 minutes.  I only needed to make a couple of changes, first to create and Input for Sprinting and second to identify where the movement speeds were contained in the Bootcamp scripts.

First, I imported my package to the Bootcamp project.


(Click the image for a larger version)
Next, I located the Survival Prefab folder which imported from the package and dragged the _Environment prefab into the Scene, then set a weather preset; in this instance Clear (Cold).




(Click the image for a larger version)
As we can see from the following image, upon pressing play we have the Environment Control Script working as it should, by seeing the Debug Information on the upper-right hand side of the screen.




(Click the image for a larger version)
Once this feature had been identified as working, I went on to integrate the Player Control Script; turning on the Debug Information and adding the Input identifier I'd created earlier from Sprinting.



(Click the image for a larger version)
Now that everything has been set up in the editor, all that was left to do was to identify the variables for movement speeds in the SoldierController script, and modify them using our SlowMovement() function.




(Click the image for a larger version)



(Click the image for a larger version)


The framework has now been set-up and successfully applied to an existing project with no more than 5 minutes of work. All that is left to do is test functionality, you can try yourself by clicking the link after the image.



(Click the image for a larger version)

Try the Web build here:  http://goo.gl/OAjfic

The build size is 50mb, loading times will vary depending on your connection speed.









No comments:

Post a Comment