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; | |
/// <summary> | |
/// Descending Timer. | |
/// </summary> | |
public class Timer : MonoBehaviour | |
{ | |
public string startTime = ""; | |
public float delayTime = 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
public void ActivateOptionsMenu(){ | |
RectTransform Canvas = GameObject.Find ("OptionsCanvas").GetComponent<RectTransform> (); | |
if (Canvas != null) { | |
RectTransform[] recs = Canvas.GetComponentsInChildren<RectTransform> (true); | |
int Count = 0; | |
int NumOfElements = 2; | |
foreach (RectTransform r in recs) { | |
if (r.gameObject.name == "Overly") { |
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; | |
using System.Collections.Generic; | |
public static class SingletonService { | |
private static Dictionary<Type, object> _singletons = new Dictionary<Type, object>(); | |
//Adds a singleton to the manager | |
public static void RegisterSingletonInstance<T>(T instance) where T : class { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>Bootstrap Template By AhmadNaser</title> | |
<!-- Bootstrap --> |
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
//convert string to array of chars | |
string text = "abcd"; | |
char[] array2 = text.ToCharArray(); | |
//1-convert char to array of bytes | |
//2-sumation of two array of bytes | |
//3-return the value of the two arays as array of chars | |
//4-get the char as an output of two array of bytes summation | |
//For More Information visit: http://www.ssec.wisc.edu/~tomw/java/unicode.html#x0600 |
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 class LevelLoader : MonoBehaviour | |
{ | |
public int calculations = 10000; | |
public int iterations = 10000; | |
public bool inAwake = true; | |
public bool inStart = true; |
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 class PlayerKeyboardController : MonoBehaviour | |
{ | |
//to make movement more smoother | |
//Change Mass to 0.1f | |
//Linear Drag to 0.4f |
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 class PlayerSmoothFollow : MonoBehaviour { | |
[SerializeField] private Transform target = null; | |
[SerializeField] private float distance = 20f; | |
[SerializeField] private float height = 5f; | |
[SerializeField] private float damping = 5f; | |
[SerializeField] private bool smoothRotation = true; |
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 class PlayerJoystick : MonoBehaviour | |
{ | |
public float speed = 0.1f, maxVelocity = 0.05f; | |
private Rigidbody2D myBody; | |
private Animator anim; | |
private bool moveLeft, moveRight; |