Skip to content

Instantly share code, notes, and snippets.

View rafaeldolfe's full-sized avatar

Rafael Dolfe rafaeldolfe

View GitHub Profile
@danieldownes
danieldownes / RandomPointOnMesh.cs
Last active April 9, 2024 12:14 — forked from v21/gist:5378391
Random point on a mesh, for Unity3D
using UnityEngine;
using System.Collections.Generic;
/// <summary>
/// Get total area of each triangle.
/// Find a random point within that total area.
/// Lookup which triangle that point relates to
/// Find a randiom point which point that triangle
/// This works for all mesh types, and gives fully distributed results.
/// Gist: https://gist.github.com/danieldownes/b1c9bab09cce013cc30a4198bfeda0aa
@binary1230
binary1230 / .gitignore (wwise)
Created March 22, 2021 15:38
WWise + Unity .gitignore file example (older, but should still work)
# unofficial .gitignore for WWise + Unity projects
# dom at audiotankstudios dot com for questions
#
# this is based on a slightly older Unity and WWise version but, should be a decent starting point
#
# Instructions:
# 1) Place this in your root folder for your Unity project
# 2) Modify "WWiseProject/" below to be the path to your .wproj folder inside your Unity assets
# Unity portion based on https://github.com/github/gitignore/blob/master/Unity.gitignore
@sinbad
sinbad / LightFlickerEffect.cs
Last active September 15, 2024 15:08
Unity simple & fast light flicker script
using UnityEngine;
using System.Collections.Generic;
// Written by Steve Streeting 2017
// License: CC0 Public Domain http://creativecommons.org/publicdomain/zero/1.0/
/// <summary>
/// Component which will flicker a linked light while active by changing its
/// intensity between the min and max values given. The flickering can be
/// sharp or smoothed depending on the value of the smoothing parameter.
@CptAsgard
CptAsgard / Greyscale.cs
Created May 15, 2014 11:24
Unity Greyscale image effect
using UnityEngine;
using System.Collections;
public class Greyscale : MonoBehaviour {
public Material mat;
void Start() {
mat.SetFloat( "_Power", 0.0f );
}
@v21
v21 / gist:5378391
Created April 13, 2013 13:23
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;