Skip to content

Instantly share code, notes, and snippets.

View klkucan's full-sized avatar
🎯
Focusing

P.P.K Wanna Be klkucan

🎯
Focusing
View GitHub Profile
@klkucan
klkucan / bits-stdc++.h
Created January 29, 2021 07:40 — forked from Einstrasse/bits-stdc++.h
bits/stdc++.h header file
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@klkucan
klkucan / UnityDiffuseLightmap.shader
Created June 22, 2018 02:34 — forked from jimfleming/UnityDiffuseLightmap.shader
Example depicting applying Unity lightmapping data to a simple diffuse shader.
Shader "Diffuse Lightmap" {
Properties {
_MainTex ("Texture 1", 2D) = "white" {}
}
SubShader {
Tags { "RenderType" = "Opaque" }
Pass {
@klkucan
klkucan / CustomTerrainShaderVF.shader
Created March 19, 2018 02:33
make a terrain with code, and you can use multiple textures
Shader "CustomTerrainShaderVF" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_SecondTex("Second (RGB)",2D) = "white"{}
_ThirdTex("ThirdTex (RGB)",2D) = "white"{}
_FourthTex("FourthTex (RGB)",2D) = "white"{}
_Mask("Mask(RG)",2D) = "white"{}
}
SubShader {
Pass {
@klkucan
klkucan / PIPE_Client.cs
Created March 15, 2018 15:27
Pipe in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Pipes;
namespace PIPE_Client
{
class Program
@klkucan
klkucan / CameraShake.cs
Created December 24, 2017 05:09
simulate camera shake
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraShake : MonoBehaviour
{
public bool debugMode = false;//Test-run/Call ShakeCamera() on start
public float shakeAmount;//The amount to shake this frame.
@klkucan
klkucan / random_sort.cs
Last active December 23, 2017 08:13
use GUID sort array, and return 3 element
oneArray.OrderBy(o => Guid.NewGuid()).Take(3).ToArray();
@klkucan
klkucan / RandomGenerator.cs
Created December 23, 2017 07:00
Random Array
using System;
using System.Collections.Generic;
using System.Linq;
namespace TestConsole
{
static class RandomGenerator
{
public static int[] KalladystineUniqueRandomNumbers(int min, int max, int howMany)
{
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(MessageBoxBehaviour))]
public class MessageBoxDrawer : PropertyDrawer
{
Vector2 scrollPos;
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
@klkucan
klkucan / ClipOptimize.cs
Created November 21, 2017 07:00
动画文件精简窗体版
/*
* 通过降低float精度,去除无用的scale曲线
* 从而降低动画的存储占用、内存占用和加载时间.
*
* 使用方法
* 通过菜单Tools/Optimise/ClipOpt打开窗口,
* 在Assets目录下选择要优化的动画,点击Optimize按钮,等待一段时间即可
*/
using UnityEditor;
@klkucan
klkucan / add local aar file.md
Created November 17, 2017 05:40 — forked from shau-lok/add local aar file.md
Android Studio add local .aar reference

Add local .aar file

  1. basic build.gradle directory using flatDir
repositories {
    mavenCentral()
    flatDir {
 dirs 'libs'