Skip to content

Instantly share code, notes, and snippets.

View gegagome's full-sized avatar

German Garces gegagome

  • Santa Barbara, CA
View GitHub Profile
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
public class UiDocumentManager : MonoBehaviour
{
UIDocument _uiDocument;
[SerializeField]
string _visualElementName, _scrollViewName, _ProgressBarName, _bpmLabelName;
using UnityEngine;
using System;
[Serializable]
public enum DriveType
{
RearWheelDrive,
FrontWheelDrive,
AllWheelDrive
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "KIDpedia Data")]
public class KIDpediaData : ScriptableObject
{
[Header("Language selector")]
public KIDpediaLanguage _selectedLanguage;
SystemLanguage _selectedSystemLanguage = SystemLanguage.English;
@gegagome
gegagome / sort.js
Last active October 2, 2019 16:14
Sort in javascript
[[2, 37], [1, 40], [3, 39], [0, 36]].sort(([,a],[,b]) => {
count;
console.log(count + " a: " + a + ", b: " + b);
count++;
return a-b})
/*
0 a: 40, b: 37
1 a: 39, b: 40
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System.Text;
using System.Collections.Generic;
public class FindDuplicates : MonoBehaviour
{
List<string> results = new List<string>();
@gegagome
gegagome / Events.cs
Last active March 5, 2019 20:03
Unity - Adding events in C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class Events : MonoBehaviour/*, IPointerUpHandler, IPointerEnterHandler, IPointerClickHandler*/
{
void Start()
{
static int[] usernameDisparity(string[] inputs)
{
// store results
int[] result = new int[inputs.Length];
// store results for array
List<int> resultInt = new List<int>();
for (int i = 0; i < inputs.Length; i++)
{
void Checker (int i)
{
if (_silenceSprites[i].enabled != true)
{
_silenceSprites[i].enabled = true;
}
else
{
_silenceSprites[i].enabled = false;
}
@gegagome
gegagome / SpritesController.cs
Last active April 29, 2018 04:15
How to handle multiple animations/animators
using System.Collections.Generic;
using UnityEngine;
public class SpritesController : MonoBehaviour {
public SpriteRenderer[] _sprites;
List<Animator> _anims = new List<Animator>();
AnimatorStateInfo _stateInfo;
int _animAudioTrack1HashActive;
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
// set these so purchase is fulfilled or fails
// OnPurchaseComplete > FullAppUnlock ()
// OnPurchaseFailed > ParentalGate.FailPurchase();