Skip to content

Instantly share code, notes, and snippets.

@konsfik
konsfik / EventsTest.cs
Last active January 4, 2019 16:39
An example of proper use of events in c#. In this example there are 10 event publishers and 1 event subscriber that subscribes to all of them. The code is heavily commented, to cover all aspects of its functionality.
using System;
using System.Collections.Generic;
/// <summary>
/// Example use of events in c#
/// Author: Konstantinos Sfikas
/// Date: January 2019
///
/// In this example there are 10 event publishers and 1 event subscriber.
/// The event publishers are all instances of the NumberCounter class,
/*
Github repo: Programmable Digital Synthesizers
Project name: Monk
Author: Kostas Sfikas
Date: April 2017
*/
// declare the array to hold the analog pins values
byte myArray[13];
@konsfik
konsfik / ProceduralAudioController.cs
Created April 6, 2017 10:46
Procedural Audio Controller class
/* Author: Kostas Sfikas
Date: April 2017
Language: c#
Platform: Unity 5.5.0 f3 (personal edition) */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
@konsfik
konsfik / WaterController.cs
Created March 26, 2017 23:21
Procedural Water Surface, c#, Unity3D
using System.Collections;
using System.Collections.Generic;
using System.Linq; //required inorder to convert list to array
using UnityEngine;
/* Source Code written by Kostas Sfikas, March 2017
Tested with Unity 5.5.0 f3 Pesonal edition*/
[RequireComponent(typeof(MeshFilter))] // making sure that the gameobject has a MeshFilter component
[RequireComponent(typeof(MeshRenderer))] // making sure that the gameobject has a MeshRenderer component
@konsfik
konsfik / ProceduralLandscapeController.cs
Created March 26, 2017 23:16
Procedural Landscape Controller, c#, Unity3D
/* Author: Kostas Sfikas
Date: March 2017
Language: C#
Platform: Unity 5.5.0 f3 (personal edition) */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq; //required for conversion of Lists to Arrays