Skip to content

Instantly share code, notes, and snippets.

View szethh's full-sized avatar
🎯
Focusing

szeth szethh

🎯
Focusing
View GitHub Profile
@szethh
szethh / ExtensionMethods.cs
Created September 3, 2019 14:03
ExtensionMethods #unity
using System.Linq;
using UnityEngine;
using System.Reflection;
using UnityEditor;
static class ExtensionMethods
{
/// <summary>
/// Rounds Vector3.
/// </summary>
@szethh
szethh / RectTransformExtensions.cs
Created September 3, 2019 14:02
RectTransformExtensions #unity #ui
public static class RectTransformExtensions
{
public static void SetLeft(this RectTransform rt, float left)
{
rt.offsetMin = new Vector2(left, rt.offsetMin.y);
}
public static void SetRight(this RectTransform rt, float right)
{
rt.offsetMax = new Vector2(-right, rt.offsetMax.y);
@szethh
szethh / RichTextAreaAttribute.cs
Last active September 3, 2019 14:04
RichTextAreaAttribute #unity
using System;
using UnityEngine;
using Sirenix.OdinInspector.Editor;
using UnityEditor;
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class RichTextAreaAttribute : Attribute
{
public bool ShowHelp { get; private set; }
public RichTextAreaAttribute()
import argparse, shlex
def main():
parser = argparse.ArgumentParser('My Command Line Program')
parser.add_argument(
'--debug',
action='store_true',
help='Print debug info'
)
subprasers = parser.add_subparsers(dest='command')