Skip to content

Instantly share code, notes, and snippets.

View dsjs-web's full-sized avatar
💭
It's now or never

DSJS dsjs-web

💭
It's now or never
View GitHub Profile
@dsjs-web
dsjs-web / MeshDestroy.cs
Created July 24, 2021 16:37 — forked from ditzel/MeshDestroy.cs
MeshDestroy => Put it on a game object with a mesh filter and renderer. Make sure to have read/write enabled on fbx import
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeshDestroy : MonoBehaviour
{
private bool edgeSet = false;
private Vector3 edgeVertex = Vector3.zero;
private Vector2 edgeUV = Vector2.zero;
@dsjs-web
dsjs-web / UnlitTransparentColored.shader
Created November 15, 2021 01:41 — forked from keijiro/UnlitTransparentColored.shader
Unlit Transparent Colored Shader
Shader "Unlit/Transparent Colored" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
ZWrite Off
@dsjs-web
dsjs-web / UniFPSCounter.cs
Created January 12, 2022 16:28 — forked from sanukin39/UniFPSCounter.cs
Simple FPS conter for Unity
using UnityEngine;
/// <summary>
/// ~ Fps counter for unity ~
/// Brief : Calculate the FPS and display it on the screen
/// HowTo : Create empty object at initial scene and attach this script!!!
/// </summary>
public class UniFPSCounter : MonoBehaviour
{
// for ui.
@dsjs-web
dsjs-web / gist:79da3cf30f96ab484dc0e0b2e0e1dfbb
Created February 1, 2022 09:14 — forked from v21/gist:5378391
A script to get a random point on a mesh, for Unity3D
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class RandomPointOnMesh : MonoBehaviour
{
public MeshCollider lookupCollider;
public bool bangGetPoint;
private Vector3 randomPoint;
Shader "Example/Decal" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" "Queue"="Geometry+1" "ForceNoShadowCasting"="True" }
LOD 200
Offset -1, -1
CGPROGRAM
@dsjs-web
dsjs-web / CameraConstantWidth.cs
Created March 21, 2022 10:43 — forked from Glavak/CameraConstantWidth.cs
Скрипт для поддержания постоянной ширины камеры в Unity, для туториала https://youtu.be/0cmxFjP375Y
using UnityEngine;
/// <summary>
/// Keeps constant camera width instead of height, works for both Orthographic & Perspective cameras
/// Made for tutorial https://youtu.be/0cmxFjP375Y
/// </summary>
public class CameraConstantWidth : MonoBehaviour
{
public Vector2 DefaultResolution = new Vector2(720, 1280);
[Range(0f, 1f)] public float WidthOrHeight = 0;
@dsjs-web
dsjs-web / MobileOcclusion.shader
Created January 14, 2023 11:31 — forked from DanMillerDev/MobileOcclusion.shader
Occlusion shader for Unity. Can be used for mobile AR Occlusion
Shader "Custom/MobileOcclusion"
{
SubShader {
Pass {
// Render the Occlusion shader before all
// opaque geometry to prime the depth buffer.
Tags { "Queue"="Geometry" }
ZWrite On
ZTest LEqual