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
| // ==UserScript== | |
| // @name SpotifyVK | |
| // @namespace com.nicloy.vkspotify | |
| // @description Import music from spotify to vk albums | |
| // @grant GM_xmlhttpRequest | |
| // @include http://vk.com/audio* | |
| // @include https://vk.com/audio* | |
| // @version 1 | |
| // ==/UserScript== |
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 UnityEditor; | |
| using System.IO; | |
| using System.Xml; | |
| using System.Collections.Generic; | |
| using System.Xml.Serialization; | |
| using animaster; | |
| using System.Linq; |
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; | |
| /* | |
| * | |
| * This script created by UNITY COMUNITY and available here http://wiki.unity3d.com/index.php?title=Singleton | |
| * | |
| * | |
| */ | |
| public abstract class MonoSingleton<T> : MonoBehaviour where T : MonoSingleton<T> | |
| { |
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
| static int cos90 = 0; | |
| static int sin90 = 1; | |
| void RotateAroundCenter(ref int x, ref int y){ | |
| int xNew, yNew; | |
| x -= 2; //piwot point x = 2 | |
| y -= 2; //piwot point y = 2; | |
| xNew = x * cos90 - y * sin90; | |
| yNew = x * sin90 + y * cos90; | |
| x = xNew + 2; | |
| y = yNew + 2; |
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
| // reflexion method posted by numberkruncher | |
| // here http://forum.unity3d.com/threads/getting-original-size-of-texture-asset-in-pixels.165295/ | |
| public class AtlasTexturePostprocessor : AssetPostprocessor { | |
| public const int PixelsPerUnit = 100; | |
| void OnPreprocessTexture(){ | |
| Texture2D tex = AssetDatabase.LoadAssetAtPath(assetPath, typeof(Texture2D )) as Texture2D; | |
| TextureImporter importer = assetImporter as TextureImporter; | |
| int textureHeight; |
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 UnityTest; | |
| /// <summary> | |
| /// Gravity test. | |
| /// | |
| /// see formulas here http://error454.com/2013/10/23/platformer-physics-101-and-the-3-fundamental-equations-of-platformers/ | |
| /// | |
| /// d = v*t + 0.5f * a * t * t //d -distance, v - initial velocity, a - aceleration, t - time | |
| /// |
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 UnityTest; | |
| /// <summary> | |
| /// | |
| /// Kinetic test. | |
| /// | |
| /// some usefull info here http://www.moaisnippets.info/using-box2d-impulses-to-move-objects | |
| /// impulse = mass * velocity; |
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 UnityEngine.UI; | |
| public class DisableToggleBG : MonoBehaviour { | |
| Image cr; | |
| void Awake () { | |
| cr = GetComponent<Image>(); | |
| GetComponentInParent<Toggle>().onValueChanged.AddListener((state) => {OnParentToggleChange(state);}); | |
| } |
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.Generic; | |
| public class GameManager : MonoBehaviour { | |
| readonly List<LifeTimeComponent> registeredComponents = new List<LifeTimeComponent>(); | |
| public void RegisterLifeComponent(LifeTimeComponent component){ | |
| if (!registeredComponents.Contains(component)) | |
| registeredComponents.Add(component); | |
| } |
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 Test : MonoBehaviour { | |
| int arraySize = 1024*2048; | |
| string status = "unknown"; | |
| float avgFPSIn = 0.0f; | |
| float avgFpsOut = 0.0f; | |
| float fps = 0.0f; |