Skip to content

Instantly share code, notes, and snippets.

View Yogioo's full-sized avatar

Yogi Yogioo

  • Hangzhou, China
  • 19:10 (UTC -12:00)
View GitHub Profile
@Yogioo
Yogioo / CustomEditorBase.cs
Created October 9, 2022 06:42 — forked from t0chas/CustomEditorBase.cs
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
@Yogioo
Yogioo / UnityTimer.cs
Created October 9, 2022 03:30
Unity Timer Tools
/*
* Unity Timer
*
* Version: 1.0
* By: Alexander Biggs + Adam Robinson-Yu
*/
using System;
using System.Collections.Generic;
@Yogioo
Yogioo / ConditionExpressionParser.cs
Created October 9, 2022 03:24
C# String Condition Expresion Parser, Example: " ((AA && !BB)|| CC) && DD ||(EE && FF)" C#字符串表达式解析器. 举例:" ((AA && !BB)|| CC) && DD ||(EE && FF)"
using System;
namespace Aster.Util.StringHandler
{
public class ConditionExpressionParser
{
public static bool Compute(bool[] p_LogicValue, string p_Expession)
{
//p_LogicValue = new bool[6] { true, false, false, true, false, true };
//假设所有bool值都用一个字母表示,也可以使用多个字母,但是需要统一字母的数量
@Yogioo
Yogioo / JSONHelper.cs
Last active October 28, 2022 14:32
Json Tools Can Serialize Dictionary. Need Include Newtonsoft.Json File. Json工具, 可以序列化字典, 需要下载C#的Newtonsoft.Json 文件
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Cysharp.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Yogi.JsonTools
@Yogioo
Yogioo / DebugEx.cs
Created October 9, 2022 03:09
Unity Debug Draw Sphere,Circle, Arrow,Box. 绘制测试用的各种基础图形脚本
using System;
using UnityEngine;
namespace Yogi.Tools
{
/// <summary>
/// 拓展Debug绘制线段
/// </summary>
public static class DebugEx
{
@Yogioo
Yogioo / AnalysisLayerTools.cs
Created October 9, 2022 03:07
Unity Analysis And Display GameObject Layer Tools, 分析Unity场景中的不同物体Layer工具
using System.Collections.Generic;
using Sirenix.OdinInspector;
using Sunset.Const;
using UnityEngine;
using Random = UnityEngine.Random;
public class AnalysisLayerTools : MonoBehaviour
{
[System.Serializable]
public struct Data
@Yogioo
Yogioo / GameObjectExtension.cs
Created October 9, 2022 03:03
Unity GameObject's Util/Static This Extension 常用GameObject的拓展方法
/****************************************************************************
* Copyright (c) 2021.4 liangxie
*
* https://qframework.cn
* https://github.com/liangxiegame/QFramework
* https://gitee.com/liangxiegame/QFramework
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@Yogioo
Yogioo / CSharpExtension.cs
Created October 9, 2022 03:03
Common Unity C# Extension 常用Unity C#拓展方法
/****************************************************************************
* Copyright (c) 2017 ~ 2020.10 liangxie
*
* https://qframework.cn
* https://github.com/liangxiegame/QFramework
* https://gitee.com/liangxiegame/QFramework
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@Yogioo
Yogioo / UITipsTools.cs
Created October 9, 2022 02:59
Unity UI Tools, Quick Set UI Position Or Anchor By Mouse Position 快捷基于鼠标设置UI位置与锚点
using UnityEngine;
/// <summary>
/// 一些UI工具
/// </summary>
public static class UITipsTools
{
/// <summary>
/// 基于鼠标位置 设置UI位置, 并且设定锚点为鼠标的位置方向 (Overlay)
/// </summary>
@Yogioo
Yogioo / UIEventListener.cs
Created October 9, 2022 02:58
Unity UI Event Listener 封装了EventTrigger 方便使用与监听
using UnityEngine;
using UnityEngine.EventSystems;
public class UIEventListener : EventTrigger
{
// refactor proper name
public System.Action onClick;
public System.Action<GameObject> onSelect;
public System.Action<GameObject> onUpdateSelect;