Skip to content

Instantly share code, notes, and snippets.

@davecdempsey
davecdempsey / DrawBounds.cs
Created June 28, 2024 20:03 — forked from unitycoder/DrawBounds.cs
Draw Bounds with Debug.DrawLine , Draw Box, Draw Runtime Gizmos
void DrawBounds(Bounds b, float delay=0)
{
// bottom
var p1 = new Vector3(b.min.x, b.min.y, b.min.z);
var p2 = new Vector3(b.max.x, b.min.y, b.min.z);
var p3 = new Vector3(b.max.x, b.min.y, b.max.z);
var p4 = new Vector3(b.min.x, b.min.y, b.max.z);
Debug.DrawLine(p1, p2, Color.blue, delay);
Debug.DrawLine(p2, p3, Color.red, delay);
@davecdempsey
davecdempsey / SetIcon.cs
Created June 20, 2024 13:31 — forked from Volantk/SetIcon.cs
Set GameObject icon in Unity
public static void SetGameObjectIcon(GameObject go, string texturePath)
{
Texture2D texture = AssetDatabase.LoadAssetAtPath<Texture2D>(texturePath);
if (texture == null)
{
Debug.LogError("Couldn't find an icon...");
return;
}
@davecdempsey
davecdempsey / LICENSE
Created March 9, 2023 16:29 — forked from JohannesMP/LICENSE
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
@davecdempsey
davecdempsey / BoxColliderWizard.cs
Created November 18, 2022 14:17 — forked from yasirkula/BoxColliderWizard.cs
Creating & editing BoxColliders intuitively in Unity
#if UNITY_EDITOR
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine.Rendering;
#endif
using UnityEngine;
public class BoxColliderWizard : MonoBehaviour
@davecdempsey
davecdempsey / LayerMaskDrawer.cs
Created November 4, 2022 01:10 — forked from lordlycastle/LayerMaskDrawer.cs
Better Layer Mask Drawer for Unity with Odin.
// ===============================
// AUTHOR : John Leonard
// CREATE DATE : 25.04.2020
// NOTE : Always include this
// Header when copying the file
// ===============================
// Licence: MIT (https://opensource.org/licenses/MIT)
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
@davecdempsey
davecdempsey / OdinWatchWindow.cs
Created November 4, 2022 01:05 — forked from Froghut/OdinWatchWindow.cs
Odin Watch Window
#if ODIN_INSPECTOR
using System;
using System.Collections.Generic;
using System.Linq;
using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities;
using Sirenix.Utilities.Editor;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
@davecdempsey
davecdempsey / ScriptableObjectCreator.cs
Created November 4, 2022 01:02 — forked from lordlycastle/ScriptableObjectCreator.cs
An awesome scriptable object creator powered by Odin. Cached from: https://bitbucket.org/snippets/Bjarkeck/keRbr4
using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities;
using Sirenix.Utilities.Editor;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
@davecdempsey
davecdempsey / KeyValueContainer.cs
Created November 4, 2022 00:47 — forked from lordlycastle/KeyValueContainer.cs
A container class that wraps around `KeyValuePair` to make it "mutable". Also Unity inspector friendly.
/// <summary>
/// A container class which encapsulates the KeyValuePair so it shows up in the editor.
/// Also allows us to update key and value without much hassle.
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
[Serializable]
public class KeyValuePairContainer<TKey, TValue>
{
/// <summary>
import java.awt.List;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;
class Main {
public static ArrayList<Integer> bPotentialColumn = new ArrayList<Integer>();
public static ArrayList<Integer> iPotentialColumn = new ArrayList<Integer>();
public static ArrayList<Integer> nPotentialColumn = new ArrayList<Integer>();
public static ArrayList<Integer> gPotentialColumn = new ArrayList<Integer>();