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 System; | |
using System.IO; | |
using System.Runtime.Serialization; | |
using System.Runtime.Serialization.Formatters.Binary; | |
using UnityEngine; | |
//to make BinarySerializer work at iOS devices add somewhere in awake: | |
//System.Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes"); | |
namespace Assets.Scripts.Tools | |
{ |
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
public Vector3 shakePower = new Vector3(0.03f, 0.03f, 0.03f); | |
public float shakeDuration = 1f; | |
private IEnumerator ShakeRoutine() | |
{ | |
for (var t = 0f; t < shakeDuration; t += Time.unscaledDeltaTime) | |
{ | |
var offset = transform.rotation * Vector3.Scale(Random.onUnitSphere, shakePower); | |
transform.position += offset; |
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
public class CloudBuildHelper | |
{ | |
#if UNITY_CLOUD_BUILD | |
public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest) | |
{ | |
var buildNumber = "unknown"; | |
manifest.TryGetValue("buildNumber", out buildNumber); | |
UnityEditor.PlayerSettings.bundleVersion = string.Format("1.0.{0}", buildNumber); |
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; | |
namespace Scripts.Common | |
{ | |
public sealed class ObjectPool : MonoBehaviour | |
{ | |
public enum StartupPoolMode { Awake, Start, CallManually }; | |
[System.Serializable] |
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; | |
namespace Assets.Scripts.Tools | |
{ | |
[RequireComponent(typeof(Text))] | |
public class FPSCounter : MonoBehaviour | |
{ | |
const float fpsMeasurePeriod = 0.5f; | |
private int m_FpsAccumulator = 0; |
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
namespace Assets.Editor | |
{ | |
public class ModelsImporter : AssetPostprocessor | |
{ | |
private void OnPreprocessModel() | |
{ | |
var modelImporter = assetImporter as ModelImporter; | |
if (modelImporter == null) | |
{ | |
Debug.LogError("Error during import of models: ModelImporter is null"); |
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; | |
using System.Collections; | |
/// <summary> | |
/// Since unity doesn't flag the Vector3 as serializable, we | |
/// need to create our own version. This one will automatically convert | |
/// between Vector3 and SerializableVector3 | |
/// </summary> | |
[System.Serializable] |
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; | |
using System.Collections; | |
/// <summary> | |
/// Since unity doesn't flag the Quaternion as serializable, we | |
/// need to create our own version. This one will automatically convert | |
/// between Quaternion and SerializableQuaternion | |
/// </summary> | |
[System.Serializable] |
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 System.Collections; | |
using UnityEngine; | |
using UnityEngine.UI; | |
namespace Scripts.Utilities | |
{ | |
public class EmbedText : MonoBehaviour | |
{ | |
[SerializeField] | |
private Text textLabel; |
OlderNewer