This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public enum SwipeDirection | |
{ | |
Null = 0,//no swipe detected | |
Duck = 1,//swipe down detected | |
Jump = 2,//swipe up detected | |
Right = 3,//swipe right detected | |
Left = 4//swipe left detected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// THREEjs build-in uniforms and attributes (Fragment) | |
// uniform mat4 viewMatrix - camera.matrixWorldInverse | |
// uniform vec3 cameraPosition - camera position in world space | |
varying vec2 vUv; | |
uniform sampler2D albedo; | |
void main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var memProfile = flag.String("memprofile", "./profile/mem.prof", "write profile to file") | |
// Run the memory profiler and write profile to file. | |
func executeMemoryProfiler() { | |
flag.Parse() | |
if *memProfile != "" { | |
f, err := os.Create(*memProfile) | |
if err != nil { | |
log.Fatal("could not create memory profile: ", err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// THREEjs build-in uniforms and attributes (Fragment) | |
// uniform mat4 viewMatrix - camera.matrixWorldInverse | |
// uniform vec3 cameraPosition - camera position in world space | |
varying vec2 vUv; | |
varying vec3 vTintColor; | |
uniform sampler2D albedo; | |
uniform sampler2D tintMask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct QueryResult | |
{ | |
QueryResult(): m_HitPos(0.0f), m_ValidHit(false) {} | |
Vec3 m_HitPos; | |
bool m_ValidHit; | |
}; | |
QueryResult Raycast( const Vec3& p0, const Vec3& p1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Projectile : MonoBehaviour | |
{ | |
[SerializeField] private GameObject target = null; | |
private const float TURN_RATE = 0.5f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var ans = GetIndexAndCount(new int[] {10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3}, 9); | |
Console.Write(ans[0] + " " + ans[1]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A utility class to mimic the Phaser Timer class but dependent on an external delta time. | |
* */ | |
export default class CoroutineUtility { | |
/** | |
* @param {Phaser.Game} game | |
* */ | |
constructor(game) { | |
this.game = game; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This .gitignore file should be placed at the root of your Unity project directory | |
# | |
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore | |
# | |
[Ll]ibrary/ | |
[Tt]emp/ | |
[Oo]bj/ | |
[Bb]uild/ | |
[Bb]uilds/ | |
[Ll]ogs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Godot-specific ignores | |
.import/ | |
export.cfg | |
android/ | |
build/ | |
# Mono-specific ignores | |
.mono/ | |
# VSCode specific ignores |