Skip to content

Instantly share code, notes, and snippets.

@grimmdev
grimmdev / CoroutineHelper.cs
Created December 28, 2020 02:25
Coroutine Helper for when you're lazy and like to use coroutines.
using System.Collections;
using UnityEngine;
public class CoroutineHelper : MonoBehaviour
{
private IEnumerator routine;
public bool isDone
{
get { return done; }
@grimmdev
grimmdev / Event.cs
Created December 19, 2020 20:46
Message System Dispatcher for Unity
using System;
[Serializable]
public class Event
{
public string name;
public Action method;
public Event(string n, Action m)
{
@grimmdev
grimmdev / Toolkit
Created April 21, 2019 06:54 — forked from gering/Toolkit
persitent data path handling in Unity with fallback
private static string[] _persistentDataPaths;
public static bool IsDirectoryWritable(string path) {
try {
if (!Directory.Exists(path)) return false;
string file = Path.Combine(path, Path.GetRandomFileName());
using (FileStream fs = File.Create(file, 1)) {}
File.Delete(file);
return true;
} catch {
// This class contains some helper functions.
using UnityEngine;
using UnityEngine.Rendering;
using Mirror;
using UnityEngine.EventSystems;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using UnityEngine;
using System.Collections;
public static class MoneyUtils {
public static string[] StringUnits = new string[41] {
string.Empty,
"k",
"m",
"b",
@grimmdev
grimmdev / PrivacyPolicy.md
Last active May 13, 2018 07:10
Privacy Policies for their respective stores.

Privacy Policy

Grimm Studios LLC is dedicated to protecting the privacy rights of its online users ("users" or “user”). This Online Privacy Policy ("Privacy Policy") has been crafted to inform users as to the ways we collect, store, use, and manage the information users provide during the use of any game or application ("Service").

By using the Service, users are agreeing to the collection and use of their personal information as outlined in this Privacy Policy. We may amend the Privacy Policy from time to time, and we encourage users to consult the Privacy Policy regularly for changes.

Policy Regarding Children

The Service is not geared toward children under the age of 13 and Grimm Studios LLC does not knowingly collect personal information from children under the age of 13. If users are under 13, they may use and access our game or app only with the involvement of a parent or guardian. If a parent believes that his or her child has submitted personal information to us, he or she can contact us th

@grimmdev
grimmdev / Perceptron.cs
Last active March 2, 2018 04:48
Perceptron for C# and Unity, based on PerceptronJS and the Perceptron Model.
using UnityEngine;
public class Perceptron {
private float accuracy = 0;
private int samples = 0;
private int[][] xtrain;
private int[] ytrain;
private int epochs;
private float learnrate;
@grimmdev
grimmdev / PocketownID.md
Last active December 31, 2017 00:50
List of ID's from Pocketown

pokeballs

  • BabyBall = 100200001
  • UltraBall = 100200002
  • GreatBall = 100200003
  • MasterBall = 100200004
  • LureBall = 100200006
  • TimerBall = 100200007
  • QuickBall = 100200008
  • DreamBall = 100200009
  • FastBall = 100200010
@grimmdev
grimmdev / demonstration.js
Created December 20, 2017 17:24
Electron and PUG
// Was able to piece the solution together using several answers from separate topics.
// Pretty simple function, passes in the window you want to use pug files and renders it
function RenderPUG(win, page)
{
let h = 'data:text/html;charset=utf-8,' + encodeURI(pug.renderFile(page))
win.loadURL(h)
}
// Example RenderPUG(mainWindow, 'views/index.pug')
@grimmdev
grimmdev / LightSwitch.ino
Created October 30, 2017 09:11
Light Switch Arduino Sensor for Relay
#define LIGHT_PIN D6 // 0 = LIGHT | 1 = DARK
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(light());
}