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; | |
/// A unility class with functions to scale Texture2D Data. | |
/// | |
/// Scale is performed on the GPU using RTT, so it's blazing fast. | |
/// Setting up and Getting back the texture data is the bottleneck. | |
/// But Scaling itself costs only 1 draw call and 1 RTT State setup! | |
/// WARNING: This script override the RTT Setup! (It sets a RTT!) | |
/// | |
/// Note: This scaler does NOT support aspect ratio based scaling. You will have to do it yourself! |
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 System; | |
using System.IO; | |
using UnityEditor; | |
using UnityEngine; | |
[CustomEditor(typeof(DefaultAsset))] | |
public class CustomAssetInspector : Editor | |
{ | |
public override void OnInspectorGUI() | |
{ |
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
// TinyTween.cs | |
// | |
// Copyright (c) 2013 Nick Gravelyn | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software | |
// and associated documentation files (the "Software"), to deal in the Software without restriction, | |
// including without limitation the rights to use, copy, modify, merge, publish, distribute, | |
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// |
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
[Serializable] | |
public class SerializableSortedList<TKey, TValue> : SortedList<TKey, TValue>, ISerializationCallbackReceiver | |
{ | |
[SerializeField] private List<TKey> keys = new List<TKey>(); | |
[SerializeField] private List<TValue> values = new List<TValue>(); | |
// Unity serialization callback before serialization | |
public void OnBeforeSerialize() | |
{ | |
keys.Clear(); |
OlderNewer