public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {
private int mItemOffset;
public ItemOffsetDecoration(int itemOffset) {
mItemOffset = itemOffset;
}
This file contains hidden or 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; | |
using DG.Tweening; | |
using System; | |
[RequireComponent(typeof(CanvasGroup))] | |
public abstract class ScreenBase : MonoBehaviour | |
{ | |
CanvasGroup canvasGroup; |
This file contains hidden or 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; | |
using DG.Tweening; | |
using System; | |
[RequireComponent(typeof(CanvasGroup))] | |
public abstract class ScreenBase : MonoBehaviour | |
{ | |
CanvasGroup canvasGroup; |
This file contains hidden or 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 class CameraShake : MonoBehaviour | |
{ | |
public static CameraShake main; | |
// Transform of the camera to shake. Grabs the gameObject's transform | |
// if null. | |
public Transform camTransform; |
This file contains hidden or 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
package ng.smartalumni.smartsocket; | |
import android.os.Handler; | |
import android.os.Looper; | |
import android.support.annotation.NonNull; | |
import org.json.JSONException; | |
import org.json.JSONObject; |
This file contains hidden or 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
Shader "Unlit/maskedSprite" | |
{ | |
Properties | |
{ | |
[Toggle]_ShowMask ("Preview mask", Float) = 0 | |
[Space] | |
[Toggle]_UseAlpha ("Vertex Alpha > Threshold", Float) = 0 | |
[Space] | |
_MaskThrs ("Mask Threshold", Range(0,1)) = .5 | |
_MaskSoft ("Mask Width", Range (0.001, 3)) = 1 |
This file contains hidden or 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
// Rotate the object from it's current rotation to "newRotation" over "duration" seconds | |
void StartRotate(Vector3 newRotation, float duration = 0.5f) | |
{ | |
if (SlerpRotation != null) // if the rotate coroutine is currently running, so let's stop it and begin rotating to the new rotation. | |
StopCoroutine(SlerpRotation); | |
SlerpRotation = Rotate(newRotation, duration); | |
StartCoroutine(SlerpRotation); | |
} |
This file contains hidden or 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.Collections.Generic; | |
using System.Collections; | |
using System.Linq; | |
using UnityEngine; | |
public class Player : MonoBehaviour { | |
[SerializeField] | |
float flippedTime = 0f; | |
float startFlip = 0f; |
This file contains hidden or 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
//helper to get a file extension | |
String.prototype.getExtension = function() { | |
var basename = this.split(/[\\/]/).pop(), // extract file name from full path ... | |
// (supports `\\` and `/` separators) | |
pos = basename.lastIndexOf("."); // get last position of `.` | |
if (basename === "" || pos < 1) // if file name is empty or ... | |
return ""; // `.` not found (-1) or comes first (0) | |
return basename.slice(pos + 1); // extract extension ignoring `.` |