Skip to content

Instantly share code, notes, and snippets.

View smkplus's full-sized avatar
😍
Curios

Seyed Morteza Kamali smkplus

😍
Curios
View GitHub Profile
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SineMovement : MonoBehaviour
{
public float MoveSpeed = 5.0f;
public float frequency = 20.0f;
@smkplus
smkplus / ConvertToSprite.cs
Last active August 3, 2019 08:24 — forked from nnm-t/ConvertToSprite.cs
Convert Texture2D To Sprite
using UnityEngine;
public static class SpriteExtensiton
{
/// <summary>
/// Convert Texture2D To Sprite
/// </summary>
/// <param name="texture"></param>
/// <returns></returns>
public static Sprite Texture2DToSprite(this Texture2D texture)
@smkplus
smkplus / SpriteLayoutGroup.md
Last active July 31, 2019 05:52
SpriteLayoutGroup

image

HorizontalSpriteLayoutGroup

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@smkplus
smkplus / ObjectPooling.md
Created July 25, 2019 04:03
Object Pooling
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TrashMan : MonoBehaviour
{
	/// <summary>
	/// ایجاد کردن پول
	/// </summary>
@smkplus
smkplus / PuzzleShader.md
Last active July 21, 2019 12:43
PuzzleShader.md

Surface Shader

Shader "Smkgames/Surface/Puzzle" {
	Properties{
		_Color("Color", Color) = (1,1,1,1)
		_MainTex("Albedo (RGB)", 2D) = "white" {}
		_Mask("Mask (A)", 2D) = "white" {}
		_Mask2("Mask (A)", 2D) = "white" {}
		_Mask3("Mask (A)", 2D) = "white" {}
@smkplus
smkplus / TabasiUIManager.md
Created May 16, 2019 03:20
Tabasi UI Manager
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.EventSystems;

public class UIManager : MonoBehaviour {

	[System.Serializable]
@smkplus
smkplus / ColorfulPrintUnity.md
Created May 15, 2019 01:59
Colorful Debug.Log Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Console : Debug
{
public static void Log(string _message,Color _color){
ColorUtility.ToHtmlStringRGB(_color);
Debug.Log(string.Format("{1}",ColorUtility.ToHtmlStringRGB(_color),_message));
@smkplus
smkplus / SimpleInkPaint.cs
Created April 18, 2019 18:14
Unity Simple Ink Paint Script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//-------------------------------------
// simple ink paintスクリプト
// ColliderとRendererは必要
[RequireComponent(typeof(Renderer))]
[RequireComponent(typeof(Collider))]
public class SimpleInkPaint : MonoBehaviour {
@smkplus
smkplus / SimpleInkPaint.shader
Created April 18, 2019 18:13
Unity Simple Ink Paint Shader
Shader "Unlit/SimpleInkPaint"
{
Properties{
_MainTex("MainTex", 2D) = "white" // メインテクスチャ
_Brush("Brush", 2D) = "white" // ブラシテクスチャ
_BrushScale("BrushScale", FLOAT) = 0.1 // ブラシサイズ
_ControlColor("ControlColor", VECTOR) = (0, 0, 0, 0) // ブラシの色
_PaintUV("Hit UV Position", VECTOR) = (0, 0, 0, 0) // ブラシで塗りたい位置
}
Shader "Custom/Cook-Torrance" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_BumpMap("Normal Map", 2D) = "bump" {}
_Metallic("Metallic", Range(0,1)) = 0.5
_MetallicTex("Metallic", 2D) = "white" {}
_Roughness("Roughness", Range(0.000000001,1)) = 0.5
_RoughnessTex("Roughness", 2D) = "white" {}
_Fresnel("Fresnel Value", Float) = 0.028