This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using SimpleJSON; | |
| class JSONMapParser : MapParser { | |
| public Map Parse(string text) { | |
| Map map = new Map(); | |
| JSONNode json = JSON.Parse(text); | |
| map.Name = json["name"]; | |
| //... populate map |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Singleton : MonoBehaviour { | |
| private static Singleton instance; | |
| /** | |
| * Retrieve the instance | |
| **/ | |
| public static Singleton GetInstance() { | |
| if (instance == null) { | |
| GameObject go = new GameObject(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma strict | |
| public class Apple extends Fruit { | |
| public function Start() { | |
| identifier = "An apple."; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class Apple : Fruit | |
| { | |
| public void Start() { | |
| weight = 0.5f; | |
| } | |
| } |