Skip to content

Instantly share code, notes, and snippets.

View liveasnotes's full-sized avatar
🔰
Eternal Beginner

liveasnotes

🔰
Eternal Beginner
View GitHub Profile
@liveasnotes
liveasnotes / AutoNetworkDiscovery.cs
Last active March 2, 2023 04:54
AutoNetworkDiscovery.cs for Unity multi play with Mirror
/*
original: https://qiita.com/OKsaiyowa/items/ecef8e5d50c84664f2a2
modified by liveasnotes
> 登録ユーザーは、本サイトに投稿したコード、スニペットなどプログラムに類するものに限り、他の登録ユーザーが商用私用問わず無償で使用することを許諾し、他の登録ユーザーはこれを使用できるものとします。
> 前各項の登録ユーザーによる利用許諾には、地域制限、著作権表示義務その他付随条件はないものとします。
cf. https://qiita.com/terms (2023-01-04 checked)
*/
// line 31
ParticleSystem.MainModule p = particles.main;
p.startSizeMultiplier *= scale;
p.startSpeedMultiplier *= scale;
p.gravityModifierMultiplier *= scale;
// particles.startSize *= scale;
// particles.startSpeed *= scale;
// particles.gravityModifier *= scale;
@liveasnotes
liveasnotes / HierarchyObjectsAlphabeticalSorter.cs
Last active November 26, 2022 07:17
unity editor extension: Hierarchy Objects Alphabetical Sorter
// Copyright 2022-2023 liveanotes
// Released under the MIT license.
// see https://opensource.org/licenses/MIT
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
namespace liveasnotes.Unity.EditorExtension.HOAS
@liveasnotes
liveasnotes / SortUnityHierarchy.cs
Last active September 6, 2021 11:18
UnityHierarchyAlphabeticalSort_vleCFZj
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace liveasnotes.EditorExtension
// cf.
// https://gametukurikata.com/program/ghost
// https://xr-hub.com/archives/20326
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace liveasnotes
{
@liveasnotes
liveasnotes / AutoSave.cs
Last active March 19, 2023 11:49 — forked from tsubaki/AutoSave.cs
Auto Save scene(& prefab). and backup/rollback scene
// (c) https://gist.github.com/tsubaki/8709502
// note: i will made this suit for newer api
// cf.
// https://gist.github.com/wakepon/b5f2802d988514dbadbc8a143e1fefd6
// https://forum.unity.com/threads/getting-list-of-all-opened-scenes.388599/
// https://webcache.googleusercontent.com/search?q=cache:BXEknzUYN0QJ:https://charcotte.hateblo.jp/entry/2019/03/28/003249
// https://web.archive.org/web/20201123162857/https://webcache.googleusercontent.com/search?q=cache%3ABXEknzUYN0QJ%3Ahttps%3A%2F%2Fcharcotte.hateblo.jp%2Fentry%2F2019%2F03%2F28%2F003249
// https://forum.unity.com/threads/editorapplication-currentscene-obsolete.374669/
using System.Collections;
@liveasnotes
liveasnotes / SelectDirectParents.cs
Last active August 20, 2020 02:10
VR4PE_20200223
// (c) 2019 liveasnotes
// https://gist.github.com/liveasnotes/1e086f9eb6d3c017760d9181d730ba45
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// ヒエラルキーウィンドウで、選択したオブジェクト(複数選択可)の直上の親オブジェクトを選択できるスクリプト
@liveasnotes
liveasnotes / SelectAllDirectChildren.cs
Last active August 20, 2020 02:08
VR4PE_20200223
// (c) 2019 liveasnotes
// https://gist.github.com/liveasnotes/cdbb66b411d5462bcb90827e51708dde
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// ヒエラルキーウィンドウで、選択したオブジェクト(複数選択可)の直下にある子オブジェクトを選択できるスクリプト
@liveasnotes
liveasnotes / FixPhysicalState.cs
Created December 15, 2019 06:56
[Unity] 親オブジェクトとの相対位置・回転の固定
using UnityEngine;
public class FixPhysicalState : MonoBehaviour
{
public bool fixPosition = true;
public bool fixRotation = true;
Vector3 own_initialRot;
Vector3 own_initialLocalPos;
@liveasnotes
liveasnotes / ExecEverySecond.cs
Created December 15, 2019 06:40
[Unity] 1秒毎に実行する
using UnityEngine;
public class ExecEverySecond : MonoBehaviour
{
float dt = 0;
void Update()
{
dt += Time.deltaTime;
if (dt > 1)