Coding practices are a source of a lot of arguments among programmers. Coding standards, to some degree, help us to put certain questions to bed and resolve stylistic debates. No coding standard makes everyone happy. (And even their existence is sure to make some unhappy.) What follows are the standards we put together on the Core team, which have become the general coding standard for all programming teams on new code development. We’ve tried to balance the need for creating a common, recognizable and readable code base with not unduly burdening the programmer with minor code formatting concerns.
This file contains 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
static Lifecycle() => Debug.Log(Prefix + "Static Constructor"); | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] static void Subs() => Debug.Log(Prefix + "Subsystem Registration"); | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)] static void AfterAsm() => Debug.Log(Prefix + "AfterAssembliesLoaded"); | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)] static void BeforeSlash() => Debug.Log(Prefix + "Before Splash"); | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] static void BeforeScene() => Debug.Log(Prefix + "BeforeScene"); | |
private void Awake() => Debug.Log(Prefix + "Awake"); | |
private void OnEnable() => Debug.Log(Prefix + "OnEnable"); | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)] static void AfterScene() => Debug.Log(Prefix + "AfterSceneLoad"); | |
[RuntimeInitializeOnLoadMethod] static void DefaultLog() => Debug.Log(Prefix + "RuntimeInit Default"); | |
void Start() => Debug |
This file contains 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
""" | |
Code that creates nested `dataclass` instances tree from JSON data. | |
Somewhat similar to what Pydantic, Schematics do out of the box, | |
but native Python dataclasses don't do automatically. | |
See discussion here for context | |
https://stackoverflow.com/questions/51564841/creating-nested-dataclass-objects-in-python | |
See tests on the bottom of this file usage examples. | |
Tested on Python 3.9 |
This file contains 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
Interesting libraries I might like to use in a project... | |
Asset loading: | |
assetsys.h - virtual filesystem with ZIP backing, overlaying, etc https://github.com/mattiasgustavsson/libs/blob/master/docs/assetsys.md | |
cute_filewatch.h - file modification watching, for runtime reloading etc https://github.com/RandyGaul/cute_headers/blob/master/cute_filewatch.h | |
flatbuffers - data serialization, zero-copy deserialization, extensible schemas https://github.com/google/flatbuffers | |
stb_image - https://github.com/nothings/stb/blob/master/stb_image.h | |
tinyexr - https://github.com/syoyo/tinyexr | |
tinygltf - https://github.com/syoyo/tinygltf | |
tinyobjloader - https://github.com/syoyo/tinyobjloader |