Projects

Unity3D Coding Examples

Unity3D-Coding-Examples

This repository includes sample projects made with Unity, with the purpose of creating a collection of reusable, manageable pieces of code that can be used as toolsets on larger-scale applications.

Table of Contents:

  1. Procedural Water Surface
    1.1. Description
    1.2. Screenshots
    1.3. Further Links
  2. Procedural Landscape
    2.1. Description
    2.2. Screenshots
    2.3. Future Plans
    2.4. Further Links
  3. Procedural Audio
    3.1. Description
    3.2. Screenshots
    3.3. Further Links

1. Procedural Water Surface

project - specific - folder: https://github.com/konsfik/Unity3D-Coding-Examples/tree/master/1-Procedural-Water-Surface

1.1. Description:

This project is a case study on “how you can procedurally generate Waves on a Custom Mesh-Surface by using C# code in Unity3D”. Keep in mind that this is not a fluid-simulation, but rather a mathematical approximation of how a fluid-surface might “look like”. Meaning that there is not an underlying physical model that drives the simulation, but only some mathematical functions (sinusoidal) that shape the surface’s form.

1.2. Screenshots:

Images Descriptions
Procedural Water Surface - editor screenshot
Procedural Water Surface - application screenshot

demo-video: https://www.youtube.com/watch?v=xy8MhL6WoSw
more info about this example: http://www.konsfik.com/procedural-water-surface-made-in-unity3d/

2. Procedural Landscape

project - specific - folder: https://github.com/konsfik/Unity3D-Coding-Examples/tree/master/2-Procedural-Landscape

2.1. Description:

This project is a case-study on “how you can procedurally generate a landscape - surface in Unity, using c# code”. It allows you to make changes and see a preview of the generated mesh in Unity editor’s edit-mode.
The aim is to also be able to save the generated mesh as a prefab, but I have not implemented this functionality yet. More details coming soon.

2.2. Screenshots:

Images Descriptions
Procedural Landscape - editor screenshot
Procedural Landscape - editor controls
Procedural Landscape - animated mode

2.3. Future plans:

This project is currently functional, however it will need some expansion (in its functionality) inorder to become an actual level-design tool.

Here is a list of the functionality that has already been implemented:

And here is the current ‘TO - DO - LIST’:

I am not sure if / when I will fulfill the list’s tasks. For the time being I am more interested in populating this repository with a variety of examples. However, I am writing these down for future reference.

demo-video: https://www.youtube.com/watch?v=mXWjAjq2yYQ
more info about this example: http://www.konsfik.com/procedural-landscape-made-in-unity3d/

3. Procedural Audio

Project - specific - folder: https://github.com/konsfik/Unity3D-Coding-Examples/tree/master/3-Procedural-Audio

3.1 Description:

This project is a case-study on “how you can procedurally generate some simple sounds from within the Unity engine, and connect those sounds with parameters of other objects in your scene”. The advantage of that is that you have access to parameters that drive the audio generation, and not only to the resulting audio. The “disadvantage” is that you must have a good understanding of digital audio inorder to create your own tools / alterations upon this example.

3.2. Screenshots:

Images Descriptions
Procedural Audio - editor screenshot
Procedural Audio - editor controls
Procedural Audio - autoPlay mode

3.3. Further links:

demo-video: https://youtu.be/fg0zjFfQJDU
more info about this example: http://www.konsfik.com/procedural-audio-made-in-unity3d/