Skip to content

Instantly share code, notes, and snippets.

@mubeenfahmed
mubeenfahmed / SwipeInput.cs
Created November 12, 2020 23:25 — forked from Fonserbc/SwipeInput.cs
A simple swipe detector for touchscreens for Unity3D. Four cardinal directions.
using UnityEngine;
/*
* Swipe Input script for Unity by @fonserbc, free to use wherever
*
* Attack to a gameObject, check the static booleans to check if a swipe has been detected this frame
* Eg: if (SwipeInput.swipedRight) ...
*
*
*/
@mubeenfahmed
mubeenfahmed / Deformable.cs
Created June 29, 2020 09:00 — forked from Nordaj/Deformable.cs
Runtime mesh deformation on impact script for Unity.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Deformable : MonoBehaviour
{
//Public
public float minImpulse = 2;
public float malleability = 0.05f;
public float radius = 0.1f;
@mubeenfahmed
mubeenfahmed / CoroutineTracker.cs
Created April 15, 2019 07:23 — forked from Jerdak/CoroutineTracker.cs
Incomplete example of how to track Unity coroutines.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Coroutine tracker.
///
/// Custom handler for coroutines that tracks when they start and stop...
/// Uses Singleton class from: http://wiki.unity3d.com/index.php/Singleton
/// </summary>
@mubeenfahmed
mubeenfahmed / maxCamera.cs
Created December 17, 2018 05:04 — forked from GuilleUCM/maxCamera.cs
Unity:Camera:Free camera control
//
//Filename: maxCamera.cs
//
// original: http://www.unifycommunity.com/wiki/index.php?title=MouseOrbitZoom
//
// --01-18-2010 - create temporary target, if none supplied at start
// - Pan = Ctrl + button
// - Orbit = Alt+button
// - Zoom = Alt + Ctrl + button
// - Reset = Space
@mubeenfahmed
mubeenfahmed / TouchCamera.cs
Created December 14, 2018 10:31 — forked from hiko9lock/TouchCamera.cs
[Unity 3D] Testing camera pan,zoom, orbit for iOS. Setting camera target after you have attached this camera script to camera object.
using UnityEngine;
using System.Collections;
public class TouchCamera : MonoBehaviour {
public Transform target;
Vector3 f0Dir= Vector3.zero;
float zoomDistance= 5;
float theta= 0.0F;
float fai= 0.0F;
float dx= 0.0F;
@mubeenfahmed
mubeenfahmed / AimCamera.cs
Created October 15, 2018 05:53 — forked from hiko9lock/AimCamera.cs
[Unity 3D] Testing camera pan,zoom, orbit for using mouse button. Setting camera rarget after you have attached this camera script to camera object. ・Hold left mouse button orbit ・Hold middle mouse button pan ・Hold ALT with right mouse button zoom
using UnityEngine;
using System.Collections;
public class AimCamera : MonoBehaviour {
public Transform target;
Vector3 f0Dir= Vector3.zero;
Vector3 upVal= Vector3.zero;
float zoomDistance= 5;
float theta= 0.0F;
float fai= 0.0F;
@mubeenfahmed
mubeenfahmed / EachDirectoryPath.md
Created July 2, 2016 20:58 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@mubeenfahmed
mubeenfahmed / MainActivity.java
Created June 13, 2016 13:24 — forked from saxman/MainActivity.java
Plotting markers on a map in Android using data from a JSON web service and the Google Maps Android API v2
/*
* Copyright (c) 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express