Skip to content

Instantly share code, notes, and snippets.

Artyom Sovetnikov Elringus

View GitHub Profile
View rfc5646-language-tags.js
// List of language tags according to RFC 5646.
// See <http://tools.ietf.org/html/rfc5646> for info on how to parse
// these language tags. Some duplicates have been removed.
var RFC5646_LANGUAGE_TAGS = {
'af': 'Afrikaans',
'af-ZA': 'Afrikaans (South Africa)',
'ar': 'Arabic',
'ar-AE': 'Arabic (U.A.E.)',
'ar-BH': 'Arabic (Bahrain)',
'ar-DZ': 'Arabic (Algeria)',
View BlendOp.shader
Shader "BlendOp"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
[Enum(UnityEngine.Rendering.BlendOp)] _BlendOp("Blend Operation", Float) = 0.0
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("Source Blend", Float) = 1.0
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Destination Blend", Float) = 1.0
}
View TilemapRendererExtension.cs
using UnityEngine.Tilemaps;
using BlendModes;
[ExtendedComponent(typeof(TilemapRenderer))]
public class TilemapRendererExtension : RendererExtension<TilemapRenderer>
{
public override string[] GetSupportedShaderFamilies ()
{
return new[] {
"SpritesDefault"
View InverseSmoothStep.cs
#if LIVE2D_AVAILABLE
using Live2D.Cubism.Core;
using Live2D.Cubism.Framework;
using System.Collections.Generic;
using System.Linq;
using UnityCommon;
using UnityEngine;
namespace Naninovel
@Elringus
Elringus / Program.cs
Created Jun 25, 2018
Stubble render empty lines for non-existing tags
View Program.cs
using Stubble.Core.Builders;
using System;
class Program
{
static string template =
@"Lorem ipsum dolor sit amet, consectetur adipiscing elit.
{{{ATag}}}
{{{ATag}}}
{{{ATag}}}
View StringUtils.cs
/// <summary>
/// Checks whether string is null, empty or consists of whitespace chars.
/// </summary>
public static bool IsNullEmptyOrWhiteSpace (string content)
{
if (String.IsNullOrEmpty(content))
return true;
return String.IsNullOrEmpty(content.TrimFull());
}
@Elringus
Elringus / SpriteGradientHSBC.shader
Last active Jan 8, 2018
Incorporates HSBC effects and gradient overlay blending for sprites.
View SpriteGradientHSBC.shader
// Incorporates HSBC effects and gradient overlay blending for sprites.
Shader "BlendModes/Extra/SpriteGradientHSBC"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_OverlayTex("Overlay Texture", 2D) = "white" {}
_OpacityTex("Opacity Mask", 2D) = "clear" {}
View ImageOutline.shader
Shader "UI/Outline"
{
Properties
{
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
_Color("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap("Pixel snap", Float) = 0
[Toggle]_IsOutlineEnabled("Enable Outline", int) = 0
[HDR]_OutlineColor("Outline Color", Color) = (1,1,1,1)
View NovelActorPerformance.cs
using UnityCommon;
/// <summary>
/// Represents a set of async actions performed by a <see cref="INovelActor"/> over time.
/// </summary>
public class NovelActorPerformance : AsyncAction<INovelActor>
{
public INovelActor Actor { get { return State; } }
private int performancesCount;
View UIOverlay.shader
Shader "BlendModes/Extra/UIOverlay"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_OverlayTex1("Overlay Texture 1", 2D) = "white" {}
_OverlayTex2("Overlay Texture 2", 2D) = "white" {}
_OverlayTex3("Overlay Texture 3", 2D) = "white" {}
_OverlayTex4("Overlay Texture 4", 2D) = "white" {}
_OverlayTex5("Overlay Texture 5", 2D) = "white" {}
You can’t perform that action at this time.