Skip to content

Instantly share code, notes, and snippets.

View somedeveloper00's full-sized avatar
🏠
Working from home

Saeed Barari somedeveloper00

🏠
Working from home
  • Iran
View GitHub Profile
using System.Diagnostics;
using Fusion;
using UnityEngine;
using Debug = UnityEngine.Debug;
namespace AAA
{
public sealed class FusionTest : MonoBehaviour
{
public int scene;
@somedeveloper00
somedeveloper00 / CameraShake.cs
Last active September 16, 2024 05:01
A minimal performant camera shaker, utilizing Unity's Collection module.
using System;
using System.Collections.Generic;
using Unity.Collections;
using UnityEngine;
using UnityEngine.Assertions;
using Random = UnityEngine.Random;
namespace TankGame.Client.Common
{
/// <summary>
@somedeveloper00
somedeveloper00 / EmailUtils.cs
Last active April 8, 2024 07:52
Send Email with C# standard libraries using SMTP
/// <summary>
/// Send an email from <param name="fromEmail"></param> to <param name="toEmail"></param> and returns the
/// <see cref="Thread"/> that is sending the email, so you can <see cref="Thread.Abort()"/> it later to cancel it.
/// </summary>
/// <param name="fromEmail">Email of the sender</param>
/// <param name="password">Password of the sender</param>
/// <param name="smtpHost">SMTP host address of the server's email service provider. Some common addresses are:
/// <list type="bullet">
/// <item>Outlook: <c>smtp-mail.outlook.com</c></item>
/// <item>Office 356: <c>smtp.office365.com</c></item>
@somedeveloper00
somedeveloper00 / CacheableOperationBase.cs
Last active January 2, 2024 19:09
Cacheable Operation in C#
// #define CACHEABLEOPERATION_VERBOSE
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
#if CACHEABLEOPERATION_VERBOSE
using UnityEngine;
#endif
@somedeveloper00
somedeveloper00 / SimpleAnimationClipRename.cs
Last active June 11, 2023 12:23
Rename animation clips
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
public class SimpleAnimationClipRename : EditorWindow {
[MenuItem( "Window/AnimationClipSuperRename" )]
public static void ShowWindow() {
GetWindow<SimpleAnimationClipRename>( "AnimationClipSuperRename" );
}
@somedeveloper00
somedeveloper00 / UpgradeTimerManager.cs
Last active May 14, 2023 11:22
Unity Timer Countdown system for upgrading items over a specific time span
using System.Collections.Generic;
using System;
using System.Linq;
using UnityEngine;
[Serializable]
public class UpgradeTimerManager {
public string id { get; private set; }
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "UI/Blurred Background" {
Properties {
_Blur ("Blur", Range(0, 1)) = 0.5
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
@somedeveloper00
somedeveloper00 / SecureDateTime.cs
Last active May 17, 2023 14:51
time sync from internet with additional options for modularizing
using System;
using System.Globalization;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
@somedeveloper00
somedeveloper00 / GameViewRender.cs
Created May 7, 2023 07:42
Unity GameView Camera Render To PNG (editor-only)
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
[RequireComponent( typeof(Camera) )]
public class GameViewRender : MonoBehaviour {
public int width = 1920;
public int height = 1080;
public int depth = 24;
@somedeveloper00
somedeveloper00 / SortOrderOffset.cs
Last active April 13, 2023 07:06
A simple Unity component for the UI to add offset to an element (and it's children)
using UnityEngine;
using UnityEngine.Serialization;
#if UNITY_EDITOR
using UnityEditor;
#endif
[ExecuteAlways]
public class SortOrderOffset : MonoBehaviour {