Skip to content

Instantly share code, notes, and snippets.

View Awais6's full-sized avatar
🏠
Working...

M Awais Awais6

🏠
Working...
View GitHub Profile
@Awais6
Awais6 / Drawer.cs
Created October 6, 2021 20:55 — forked from AngryAnt/Drawer.cs
Attempting to override the default UnityEvent drawer.
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine.Events;
using System.Reflection;
namespace Test
{
[CustomPropertyDrawer (typeof (UnityEventBase), true)]
@Awais6
Awais6 / ExampleBehavior.cs
Created June 12, 2021 19:17 — forked from ProGM/ExampleBehavior.cs
A PropertyDrawer to show a popup field with a generic list of string for your Unity3d attribute
public class MyBehavior : MonoBehaviour {
// This will store the string value
[StringInList("Cat", "Dog")] public string Animal;
// This will store the index of the array value
[StringInList("John", "Jack", "Jim")] public int PersonID;
// Showing a list of loaded scenes
[StringInList(typeof(PropertyDrawersHelper), "AllSceneNames")] public string SceneName;
}
@Awais6
Awais6 / UpdateCoinsText Animation c# unity
Last active October 12, 2020 14:07
UpdateCoinsTest Animation slowely increase coins in c# unity.
private IEnumerator UpdateCoinsAmount (int prevCoins, int newCoins)
{
// Animation for increasing and decreasing of coins amount
const float seconds = 0.5f;
float elapsedTime = 0;
while (elapsedTime < seconds) {
CurrentCoinsText.text = Mathf.Floor(Mathf.Lerp (prevCoins, newCoins, (elapsedTime / seconds))).ToString();
elapsedTime += Time.deltaTime;
yield return new WaitForEndOfFrame ();
@Awais6
Awais6 / AdbCommands
Created August 19, 2019 12:30 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell