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 UnityEngine;
using System.Collections;
using UnityEngine.UI;
using DG.Tweening;
using UnityEngine.EventSystems;
public class SettingsPanel : MonoBehaviour {
RectTransform _aRect;
bool _isHidden = true;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DragRigidbody : MonoBehaviour {
Vector3 screenPoint;
Vector3 offset;
void Update () {
using UnityEngine.EventSystems;
using UnityEngine;
public class Stem : MonoBehaviour, IPointerDownHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerClickHandler
{
Vector3 _pos;
Vector3 _posOffset;
RectTransform _thisRectTransform;
RectTransform _parentRectTransform;
Rigidbody2D _rb;
IEnumerator VolumeChange (int stem, float initVol, float endVol, float time) {
float timeElapsed = 0f;
while (_stems[stem].volume != endVol) {
_stems[stem].volume = Mathf.Lerp(initVol, endVol, timeElapsed * 2);
timeElapsed += Time.deltaTime;
Debug.Log("timeElapsed: " + timeElapsed + "\n" + "Time.deltaTime: " + Time.deltaTime + "\n" + "volume: " + _stems[stem].volume);
yield return null;
}
_stems[stem].mute = !_stems[stem].mute;
}
@gegagome
gegagome / IAPManager.cs
Created April 2, 2017 05:06
Unity persistent data script
// basic persistant data saving and loading: https://unity3d.com/learn/tutorials/topics/scripting/persistence-saving-and-loading-data
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
public class IAPManager : MonoBehaviour {
using UnityEngine;
using DarkTonic.MasterAudio;
public class LanguageController: MonoBehaviour {
public static SystemLanguage _selectedLanguage;
void Awake () {
_selectedLanguage = GetLanguage();
}
@gegagome
gegagome / Purchaser3.cs
Last active February 4, 2021 17:45
Unity IAP
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
// Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing.
using UnityEngine.Purchasing.Security;
public class Purchaser : MonoBehaviour, IStoreListener
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
// Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing.
using UnityEngine.Purchasing.Security;
public class Purchaser : MonoBehaviour, IStoreListener
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
// Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing.
using UnityEngine.Purchasing.Security;
public class Purchaser : MonoBehaviour, IStoreListener
@gegagome
gegagome / Purchaser.cs
Last active February 13, 2025 19:00
Unity IAP
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;
// Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing.
using UnityEngine.Purchasing.Security;
public class Purchaser : MonoBehaviour, IStoreListener