This commit is contained in:
JA
2026-06-27 03:36:46 +08:00
parent aec4e97d27
commit 7a8d4a5d83
1215 changed files with 48271 additions and 146052 deletions

View File

@@ -1,81 +0,0 @@
//using UnityEngine;
//using System.Collections;
//using UnityEditor;
//using System.IO;
//using System.Collections.Generic;
/// < summary >
/// 切割
/// </ summary >
//public static class ImageSlicer
//{
// [MenuItem("Assets/ImageSlicer/Process to Sprites")]
// static void ProcessToSprite()
// {
// Texture2D image = Selection.activeObject as Texture2D;//获取旋转的对象
// string rootPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(image));//获取路径名称
// string path = rootPath + "/" + image.name + ".PNG";//图片路径名称
// TextureImporter texImp = AssetImporter.GetAtPath(path) as TextureImporter;//获取图片入口
// AssetDatabase.CreateFolder(rootPath, image.name);//创建文件夹
// foreach (SpriteMetaData metaData in texImp.spritesheet)//遍历小图集
// {
// Texture2D myimage = new Texture2D((int)metaData.rect.width, (int)metaData.rect.height);
// abc_0: (x: 2.00, y: 400.00, width: 103.00, height: 112.00)
// for (int y = (int)metaData.rect.y; y < metaData.rect.y + metaData.rect.height; y++)//Y轴像素
// {
// for (int x = (int)metaData.rect.x; x < metaData.rect.x + metaData.rect.width; x++)
// myimage.SetPixel(x - (int)metaData.rect.x, y - (int)metaData.rect.y, image.GetPixel(x, y));
// }
// 转换纹理到EncodeToPNG兼容格式
// if (myimage.format != TextureFormat.ARGB32 && myimage.format != TextureFormat.RGB24)
// {
// Texture2D newTexture = new Texture2D(myimage.width, myimage.height);
// newTexture.SetPixels(myimage.GetPixels(0), 0);
// myimage = newTexture;
// }
// DeCompress(myimage);
// var pngData = myimage.EncodeToPNG();
// AssetDatabase.CreateAsset(myimage, rootPath + "/" + image.name + "/" + metaData.name + ".PNG");
// File.WriteAllBytes(rootPath + "/" + image.name + "/" + metaData.name + ".PNG", pngData);
// 刷新资源窗口界面
// AssetDatabase.Refresh();
// }
// }
// / <summary>
// /
// / </summary>
// / <param name = "source" ></ param >
// / < returns ></ returns >
// public static Texture2D DeCompress(Texture2D source)
// {
// RenderTexture renderTex = RenderTexture.GetTemporary(
// source.width,
// source.height,
// 0,
// RenderTextureFormat.Default,
// RenderTextureReadWrite.Linear);
// Graphics.Blit(source, renderTex);
// RenderTexture previous = RenderTexture.active;
// RenderTexture.active = renderTex;
// Texture2D readableText = new Texture2D(source.width, source.height);
// readableText.ReadPixels(new Rect(0, 0, renderTex.width, renderTex.height), 0, 0);
// readableText.Apply();
// RenderTexture.active = previous;
// RenderTexture.ReleaseTemporary(renderTex);
// return readableText;
// }
//}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a585f91919ecc5049b0440e503ce7482
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: cc6de09ab7131f9468c2acea40471f24
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,72 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PollBase : MonoBehaviour
{
//自动释放时间/秒
protected float m_ReleaseTime;
//上次释放的时间/毫微秒 10……7
protected long m_LastReleaseTime = 0;
//对象池
protected List<PollObject> m_Objects;
public void Start()
{
m_LastReleaseTime = System.DateTime.Now.Ticks;
}
/// <summary>
/// 初始化对象池
/// </summary>
/// <param name="time"></param>
public void Init(float time)
{
m_ReleaseTime = time;
m_Objects = new List<PollObject>();
}
/// <summary>
/// 取出对象
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public virtual Object Spwan(string name)
{
foreach (PollObject po in m_Objects)
{
if (po.Name == name)
{
m_Objects.Remove(po);
return po.Object;
}
}
return null;
}
/// <summary>
/// 回收
/// </summary>
/// <param name="name"></param>
/// <param name="obj"></param>
public virtual void UnSpwan(string name, Object obj)
{
PollObject po = new PollObject(name, obj);
m_Objects.Add(po);
}
/// <summary>
/// 释放
/// </summary>
public virtual void Release()
{
}
private void Update()
{
if (System.DateTime.Now.Ticks - m_LastReleaseTime >= m_ReleaseTime * 10000000)
{
m_LastReleaseTime = System.DateTime.Now.Ticks;
Release();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 9ba11d249cb380348b661dda9386a33a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,18 +0,0 @@
using UnityEngine;
public class PollObject
{
//对象
public Object Object;
//对象名
public string Name;
//最后一次的使用时间,记录销毁
public System.DateTime lastUserTime;
public PollObject(string name, Object obj)
{
Name = name;
Object = obj;
lastUserTime = System.DateTime.Now;
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 3d7860cc304322b41a0233c9cf94ab61
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,40 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RsertTriger : StateMachineBehaviour
{
public string[] trigger;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
foreach (var info in trigger)
{
animator.ResetTrigger(info);
}
}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
//override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
//{
//
//}
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
//override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
//{
//
//}
// OnStateMove is called right after Animator.OnAnimatorMove()
//override public void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
//{
// // Implement code that processes and affects root motion
//}
// OnStateIK is called right after Animator.OnAnimatorIK()
//override public void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
//{
// // Implement code that sets up animation IK (inverse kinematics)
//}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ee7bc4befba7eea4eab0ccc3c78f51aa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,38 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class MonoSingleton<T> : MonoBehaviour where T : MonoBehaviour
{
public bool global=true;
private static T instance;
public static T Instance
{
get
{
if (instance == null)
instance = FindObjectOfType<T>();
return instance;
}
}
void Awake()
{
if (global)
{
if (instance != null && instance != this.gameObject.GetComponent<T>())
{
Destroy(this.gameObject);
return;
}
DontDestroyOnLoad(this.gameObject);
instance = this.gameObject.GetComponent<T>();
}
this.OnStart();
}
protected virtual void OnStart()
{
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 29d9d55349331304fb3da0aa1c10e559
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
class Resloader
{
public static T Load<T>(string path) where T : UnityEngine.Object
{
return Resources.Load<T>(path);
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 6e7452ecf3eb2b94c8af2b8b2f16c9ac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: