Skip to content

Instantly share code, notes, and snippets.

View oxysoft's full-sized avatar

Nicolas Martel oxysoft

View GitHub Profile
using System;
using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities.Editor;
using UnityEditor;
using UnityEngine;
using Random = System.Random;
/// <summary>
/// Draw the properties with a darker background and
/// borders, optionally.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Sirenix.OdinInspector;
using Sirenix.Utilities;
using UnityEngine;
#if UNITY_EDITOR
using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities.Editor;
using System;
using System.Collections.Generic;
using Sirenix.OdinInspector.Editor;
using Sirenix.OdinInspector.Editor.Validation;
using Sirenix.Utilities.Editor;
using UnityEngine;
[DrawerPriority(0.0, 10000.1)]
public class MiniValidationDrawer<T> : OdinValueDrawer<T>, IDisposable
{
#if UNITY_EDITOR
using System;
using System.Linq;
using OdinExtensions;
using Sirenix.OdinInspector.Editor;
using Sirenix.OdinInspector.Editor.Validation;
using Sirenix.Serialization;
using UnityEngine;
using Object = UnityEngine.Object;
@oxysoft
oxysoft / GetPointClosestTo.cs
Last active March 13, 2021 00:15
Optimized algorithm I made which finds the closest point on a bezier spline to another arbitrary P point
public Vector3 GetPointClosestTo(Vector3 p, out float result, out int curve) {
// an optimized algorithm i invented which finds the closest point on a bezier to another arbitrary P point
// this algorithm is iteration based, meaning that the more iterations your perform, the more precise the results will be
// it is optimized to be fast but this particular implemention is not necessarily as fast as it could be, and the code is certainly not pretty
// optimizing this is left as an exercise to the viewer
// points is a vector3 array which defines the anchors and control points of the current bezier curve in the following format
// [anchor, control, control] * n, [anchor]
// where n is as many bezier curves which this spline defines. it pieces multiple bezier curves together, although the algorithm could be adapted for single curves that are alone
//groovy maplestory npc DSL example
//the parameter is npc id
def npc = new NpcBuilder(1337)
npc {
next "Yo what's up ?!?"
next "I'm pretty good how bout u??"
next_player "Yea bro im good here"
selections ["yo try this puzzle \r\n\r\nwhich 1 is not a cabbage???", [
@oxysoft
oxysoft / gist:9589295
Created March 16, 2014 20:20
shortened
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as