Skip to content

Instantly share code, notes, and snippets.

View RimuruDev's full-sized avatar
🌅
Unity + Yandex Games

Rimuru RimuruDev

🌅
Unity + Yandex Games
View GitHub Profile
@olegmrzv
olegmrzv / PlayerLoopCleaner.cs
Created April 4, 2024 13:07
PlayerLoop Disable Unity Modules
using System;
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
public static class PlayerLoopCleaner
{
private static readonly Type[] typesToRemove = new Type[] {
typeof(EarlyUpdate.Physics2DEarlyUpdate),
// Physics 2D
@RimuruDev
RimuruDev / .gitignore
Last active December 27, 2023 17:01
Обновленный gitignore для видео https://www.youtube.com/watch?v=81hnAmuusGw Нужно скопировать содержимое файла ниже в ваш старый gitignore или заменить его. Убедитесь что формат вашего gitignore не .txt а .gitignore
# RimuruDev
# https://github.com/RimuruDev
**idea/
**.idea/
**.ws/
**.vs/
**/[Bb]uilds/
*/[Tt]rash/
*/[Tt]rash.meta
// **************************************************************** //
//
// Copyright (c) RimuruDev. All rights reserved.
// Contact me:
// - Gmail: rimuru.dev@gmail.com
// - GitHub: https://github.com/RimuruDev
// - LinkedIn: https://www.linkedin.com/in/rimuru/
// - GitHub Organizations: https://github.com/Rimuru-Dev
//
// **************************************************************** //
@RimuruDev
RimuruDev / Curtain.cs
Created August 23, 2023 19:55
⭐️My favorite and lazy class implementing game loading animation on Unity⭐️
// ReSharper disable All
// **************************************************************** //
//
// Copyright (c) RimuruDev. All rights reserved.
// Contact me:
// - Gmail: rimuru.dev@gmail.com
// - GitHub: https://github.com/RimuruDev
// - LinkedIn: https://www.linkedin.com/in/rimuru/
//
// **************************************************************** //
@RimuruDev
RimuruDev / UnityWebGLDetectOrientation.js
Last active August 18, 2023 11:51
Как определить ориентацию экрана JS Unity Webgl. Определить iPad ориентацию Unity. RimuruDev.
window.addEventListener('orientationchange', function ()
{
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent) && typeof screen.orientation !== 'undefined')
{
switch (screen.orientation.type)
{
case 'portrait-primary':
case 'portrait-secondary':
canvas.style.background = "url('portrait.png') center / cover";
break;
@RimuruDev
RimuruDev / BackgroundScaler.cs
Last active December 20, 2023 10:35
⭐️Automatically resize backgrounds based on SpriteRenderer. You can change the screen format any way you want, even 1920x1080 or 5000x800 the background will not go out of the screen.⭐️
// ReSharper disable CommentTypo
// **************************************************************** //
//
// Copyright (c) RimuruDev. All rights reserved.
// Contact me:
// - Gmail: rimuru.dev@gmail.com
// - LinkedIn: https://www.linkedin.com/in/rimuru/
// - Gists: https://gist.github.com/RimuruDev/61e9f0111b35d3e67ef18fab611d7595
// **************************************************************** //
@RimuruDev
RimuruDev / Yandex Game Plugin Bug
Last active June 14, 2023 08:16
Building Library\Bee\artifacts\Android\19qtv\libil2cpp.so failed with output: ld.lld: error: undefined symbol: ExecuteCodeRTB1 Yandex Game Plugin Bug
Add for all scripts #if UNITY_WEBGL
Example
using UnityEngine;
using UnityEngine.UI;
#if UNITY_WEBGL
namespace YG.Example
{
@RimuruDev
RimuruDev / README.md
Created June 6, 2023 19:12 — forked from JohannesDeml/README.md
Remove Unity mobile notification warning for WebGL builds

Remove warning

Unity shows the following warning on mobile devices up to Unity 2019.4: "Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway." This script helps you remove this warning

Live example

To see live examples see Unity Web GL Loading Test

Logic

The script will run after the build has completed and replace the checks from all generated javascript files.

Support

@RimuruDev
RimuruDev / MeshDestroy.cs
Created January 13, 2023 20:36 — forked from ditzel/MeshDestroy.cs
MeshDestroy => Put it on a game object with a mesh filter and renderer. Make sure to have read/write enabled on fbx import
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeshDestroy : MonoBehaviour
{
private bool edgeSet = false;
private Vector3 edgeVertex = Vector3.zero;
private Vector2 edgeUV = Vector2.zero;
@RimuruDev
RimuruDev / IconPreviewWindow.cs
Last active April 29, 2023 09:35
Drawing icons in Unity custom panel #RimuruDev
using UnityEditor;
using UnityEngine;
// The script must be in the Editor folder
public sealed class IconPreviewWindow : EditorWindow
{
[MenuItem("RimuruDevTool/Icon Preview")]
private static void Initialization()
{
var window = (IconPreviewWindow)GetWindow(typeof(IconPreviewWindow));