Skip to content

Instantly share code, notes, and snippets.

@baruchadi
baruchadi / SoundEffectSO.cs
Created July 31, 2021 17:00
Sound effect scriptable object, allows for multiple sound files, varying pitch & volume configuration, and ability to control pitch by semitones
using Sirenix.OdinInspector;
using UnityEditor;
using UnityEngine;
using Utils;
using Random = UnityEngine.Random;
namespace ScriptableObjects
{
[CreateAssetMenu(fileName = "NewSoundEffect", menuName = "Audio/New Sound Effect")]
public class SoundEffectSO : ScriptableObject
@baruchadi
baruchadi / DrowsyLogger.cs
Last active February 12, 2024 12:30
useful Debug.log extensions
using System;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Utils
{
public static class DrowsyLogger
{
public static string Color(this string myStr, string color)
{
InvalidCastException: Cannot cast Newtonsoft.Json.Linq.JObject to Newtonsoft.Json.Linq.JToken.
Newtonsoft.Json.Linq.Extensions.Convert[T,U] (T token) (at <72bc94bec6c44acf84d97f15326490ac>:0)
Newtonsoft.Json.Linq.Extensions.Value[T,U] (System.Collections.Generic.IEnumerable`1[T] value) (at <72bc94bec6c44acf84d97f15326490ac>:0)
Newtonsoft.Json.Linq.Extensions.Value[U] (System.Collections.Generic.IEnumerable`1[T] value) (at <72bc94bec6c44acf84d97f15326490ac>:0)
Unity.RemoteConfig.Editor.UIComponents.SettingsTreeView.CellGUI (UnityEngine.Rect cellRect, Unity.RemoteConfig.Editor.UIComponents.TreeViewItem`1[T] item, System.Int32 column, UnityEditor.IMGUI.Controls.TreeView+RowGUIArgs& args) (at Library/PackageCache/com.unity.remote-config@1.3.1-preview.1/Editor/UIComponents/SettingsTreeview.cs:414)
Unity.RemoteConfig.Editor.UIComponents.SettingsTreeView.RowGUI (UnityEditor.IMGUI.Controls.TreeView+RowGUIArgs args) (at Library/PackageCache/com.unity.remote-config@1.3.1-preview.1/Editor/UIComponents/SettingsTreeview.c