Skip to content

Instantly share code, notes, and snippets.

View 3dln's full-sized avatar
🌞
blessed

Ashcan Ashtin 3dln

🌞
blessed
View GitHub Profile
@3dln
3dln / ModelAnimation.cs
Created September 23, 2018 08:22
Adds scale, rotate and move animation loops to the game objects
using UnityEngine;
using System.Collections;
public class ModelAnimation : MonoBehaviour {
public bool isAnimated = false;
public bool isRotating = false;
public bool isFloating = false;
public bool isScaling = false;
@3dln
3dln / DepthMask.shader
Created September 21, 2018 06:12
Depth mask is a shader for concealing objects in AR used for AR window effects and hiding underground models
Shader "DepthMask" {
SubShader {
// Render the mask after regular geometry, but before masked geometry and
// transparent things.
Tags {"Queue" = "Geometry-10" }
// Turn off lighting, because it's expensive and the thing is supposed to be
// invisible anyway.
@3dln
3dln / MaterialChanger.cs
Created September 19, 2018 08:35
A Simple Script to change the materials on a game object and all the nested children
// A Simple Script to change the materials on a game object and all the nested children
// Author: Ashkan Ashtiani
// Github: https://github.com/3dln/material_changer
using System.Collections.Generic;
using UnityEngine;
namespace TDLN
{
public class MaterialChanger : MonoBehaviour
@3dln
3dln / CameraOrbit.cs
Last active February 11, 2025 04:35
A simple Unity C# script for orbital movement around a target gameobject
// A simple Unity C# script for orbital movement around a target gameobject
// Author: Ashkan Ashtiani
// Gist on Github: https://gist.github.com/3dln/c16d000b174f7ccf6df9a1cb0cef7f80
using System;
using UnityEngine;
namespace TDLN.CameraControllers
{
public class CameraOrbit : MonoBehaviour