Skip to content

1.x #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 2, 2024
Merged

1.x #81

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
```
█████╗ ██╗ ██████╗ ██╗ ██╗███╗ ██╗██╗████████╗██╗ ██╗ ██████╗██╗ ██╗ █████╗ ███████╗███████╗███████╗████████╗
██╔══██╗██║██╔═══██╗ ██║ ██║████╗ ██║██║╚══██╔══╝╚██╗ ██╔╝ ██╔════╝██║ ██║ ██╔══██╗██╔════╝██╔════╝██╔════╝╚══██╔══╝
███████║██║██║ ██║ ██║ ██║██╔██╗ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║ ███████║███████╗███████╗█████╗ ██║
██╔══██║██║██║ ██║ ██║ ██║██║╚██╗██║██║ ██║ ╚██╔╝ ██║ ██║ ██║ ██╔══██║╚════██║╚════██║██╔══╝ ██║
██║ ██║██║╚██████╔╝ ╚██████╔╝██║ ╚████║██║ ██║ ██║ ╚██████╗███████╗██║ ██║ ██║███████║███████║███████╗ ██║
╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ ╚═╝
██╗ ██╗███╗ ██╗██╗████████╗██╗ ██╗ ██████╗██╗ ██╗ █████╗ ███████╗███████╗███████╗████████╗
██║ ██║████╗ ██║██║╚══██╔══╝╚██╗ ██╔╝ ██╔════╝██║ ██║ ██╔══██╗██╔════╝██╔════╝██╔════╝╚══██╔══╝
██║ ██║██╔██╗ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║ ███████║███████╗███████╗█████╗ ██║
██║ ██║██║╚██╗██║██║ ██║ ╚██╔╝ ██║ ██║ ██║ ██╔══██║╚════██║╚════██║██╔══╝ ██║
╚██████╔╝██║ ╚████║██║ ██║ ██║ ╚██████╗███████╗██║ ██║ ██║███████║███████║███████╗ ██║
╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ ╚═╝
```
<p align="center"> <a href="README_EN.md"> English </a> | 简体中文 </p>
<p align="center">
Expand Down
35 changes: 35 additions & 0 deletions .github/qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#-------------------------------------------------------------------------------#
# Qodana analysis is configured by qodana.yaml file #
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
#-------------------------------------------------------------------------------#
version: "1.0"
linter: jetbrains/qodana-dotnet:2023.3
include:
- name: CheckDependencyLicenses

#Specify IDE code to run analysis without container (Applied in CI/CD pipeline)
ide: QDNET

#Specify inspection profile for code analysis
profile:
name: qodana.starter

#Enable inspections
#include:
# - name: <SomeEnabledInspectionId>

#Disable inspections
exclude:
- name: All
paths:
- "Resources/Editor"
- "*.meta"
- "*.asmdef"
- "*.tt"

#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
#bootstrap: sh ./prepare-qodana.sh

#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
#plugins:
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)
30 changes: 30 additions & 0 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 🧬 Code Optimize Qodana
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
tags: # 当生成指定标签时触发
- '*.*.*'
branches: # Specify your branches here
- main
- '1.*'
jobs:
qodana:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # 检查实际的pull请求提交,而不是合并提交
fetch-depth: 0 # 拉请求分析需要完整的历史记录
- name: 🧬 Qodana Scan
uses: JetBrains/[email protected]
with:
pr-mode: false
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
32 changes: 26 additions & 6 deletions .github/workflows/github-close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# Abandoned Issues and Pull Request".
# https://igorwiese.com/images/papers/Paper_BotSE_19.pdf

name: GitHub - Close stale issues
name: 🧪 GitHub - Close stale issues
on:
schedule: [cron: "50 0 * * 1"] # run weekly Monday 00:50 UTC
schedule: [ cron: "50 0 * * 1" ] # run weekly Monday 00:50 UTC
workflow_dispatch:
jobs:
job-close-stale-issues:
Expand All @@ -32,8 +32,28 @@ jobs:
exempt-issue-labels: 'blocker,bug,enhancement,help wanted,regression'
days-before-stale: 90
days-before-close: 30
stale-issue-message: 'This issue is stale because it has been open for 90 days with no activity. Please remove the stale label or add a comment or this issue will be closed in 30 days.'
stale-pr-message: 'This PR is stale because it has been open for 90 days with no activity. Please remove the stale label or add a comment or this PR will be closed in 30 days.'
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity. Please feel free to reopen.'
close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity. Please feel free to reopen.'
stale-issue-message: |
### English
This issue is stale because it has been open for 90 days with no activity.
Please remove the stale label or add a comment or this issue will be closed in 30 days.
### 中文
此问题已经打开了90天没有活动,因此已经过时。
请删除过时标签或添加评论,否则此问题将在30天内关闭。
stale-pr-message: |
### English
This PR is stale because it has been open for 90 days with no activity.
Please remove the stale label or add a comment or this PR will be closed in 30 days.
### 中文
此拉取请求已经打开了90天没有活动,因此已经过时。
请删除过时标签或添加评论,否则此拉取请求将在30天内关闭。
close-issue-message: |
### English
This issue was closed because it has been stale for 30 days with no activity. Please feel free to reopen.
### 中文
此问题已经过时30天没有活动,因此已经关闭。请随时重新打开。
close-pr-message: |
### English
This PR was closed because it has been stale for 30 days with no activity. Please feel free to reopen.
### 中文
此拉取请求已经过时30天没有活动,因此已经关闭。请随时重新打开.
repo-token: ${{ secrets.GITHUB_TOKEN }}
39 changes: 25 additions & 14 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 🧪 CI Greetings

on: [pull_request_target, issues]
on: [ pull_request_target, issues ]

jobs:
greeting:
Expand All @@ -9,16 +9,27 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hello @${{ github.actor }} , thank you for submitting an issue!"
pr-message: "Hello @${{ github.actor }} , thank you submitting a pull request!"
issuesOpened: |
👋 @{{ author }} Thank you for raising an issue.
We will will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
pullRequestOpened: |
👋 @{{ author }}
Thank you for raising your pull request.
Please make sure you have followed our contributing guidelines. We will review it as soon as possible
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hello @${{ github.actor }} , thank you for submitting an issue!"
pr-message: "Hello @${{ github.actor }} , thank you submitting a pull request!"
issuesOpened: |
### English
👋 @{{ author }} Thank you for raising an issue.
We will will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
### 中文
👋 @{{ author }} 感谢您提出问题。
我们将调查此问题并尽快回复您。
请确保您尽可能提供尽可能多的上下文。

pullRequestOpened: |
### English
👋 @{{ author }}
Thank you for raising your pull request.
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
### 中文
👋 @{{ author }}
感谢您提出拉取请求。
请确保您已遵循我们的贡献准则。我们将尽快审查它。
7 changes: 3 additions & 4 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# To use this workflow, you will need to set up a .github/workflows/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: 🧬 CI Labeler
on: [pull_request_target]
name: 🧪 CI Labeler
on: [ pull_request_target ]

jobs:
label:

runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/reademe-contributors.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: 🧪 CI Generate a list of contributors
on:
push:
branches:
- main

name: 🧪 CI Generate a list of contributors

jobs:
contrib-readme-en-job:
runs-on: ubuntu-latest
Expand All @@ -15,9 +13,9 @@ jobs:
with:
image_size: 64
readme_path: .github/README.md
use_username: true
use_username: true
commit_message: "🤖 [contrib-readme-action] : updated readme"
committer_username: "Action Contrib Readme"
committer_email: "[email protected]"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests

on:
schedule:
- cron: '30 08 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
14 changes: 8 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@
*.git
*.vscode

# 编译器
.git/
.vs/
.gradle/
.idea/
.vscode/
.consulo/

!*.dll.meta
!*.asset.meta
!*.asmdef.meta
!*.cs.meta

.git/
.vs/
.idea/
.gradle/
.consulo/
[Bb]uild/
[Bb]uilds/
[Tt]emp/
[Oo]bj/
[Ll]ogs/
[Bb]in/
[Oo]bj/
[Pp]ackages/
[Vv]env/
38 changes: 18 additions & 20 deletions Editor/Data/AssetBuildConfig.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Linq;
using AIO.UEngine;
using UnityEditor;
using UnityEngine;
Expand Down Expand Up @@ -64,28 +65,25 @@ public partial class AssetBuildConfig : ScriptableObject
/// </summary>
public static AssetBuildConfig GetOrCreate()
{
if (_instance is null)
{
var objects = EHelper.IO.GetScriptableObjects<AssetBuildConfig>();
if (objects != null && objects.Length > 0)
foreach (var asset in objects)
{
if (asset is null) continue;
if (string.IsNullOrEmpty(asset.BuildOutputPath))
asset.BuildOutputPath = Path.Combine(EHelper.Path.Project, "Bundles");

_instance = asset;
break;
}

if (_instance is null)
if (_instance != null) return _instance;

var objects = EHelper.IO.GetScriptableObjects<AssetBuildConfig>();
if (objects != null && objects.Length > 0)
foreach (var asset in objects.Where(asset => asset))
{
_instance = CreateInstance<AssetBuildConfig>();
_instance.BuildOutputPath = Path.Combine(EHelper.Path.Project, "Bundles");
AssetDatabase.CreateAsset(_instance, "Assets/Editor/ASBuildConfig.asset");
AssetDatabase.SaveAssets();
if (string.IsNullOrEmpty(asset.BuildOutputPath))
asset.BuildOutputPath = Path.Combine(EHelper.Path.Project, "Bundles");

_instance = asset;
break;
}
}

if (_instance) return _instance;

_instance = CreateInstance<AssetBuildConfig>();
_instance.BuildOutputPath = Path.Combine(EHelper.Path.Project, "Bundles");
AssetDatabase.CreateAsset(_instance, "Assets/Editor/ASBuildConfig.asset");
AssetDatabase.SaveAssets();

return _instance;
}
Expand Down
16 changes: 9 additions & 7 deletions Editor/Data/Collect/Root/AssetCollectRoot.Helper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using UnityEditor;
using Object = UnityEngine.Object;

Expand Down Expand Up @@ -114,11 +115,11 @@ public static AssetCollectRoot GetOrCreate()
var objects = EHelper.IO.GetScriptableObjects<AssetCollectRoot>();
if (objects != null && objects.Length > 0)
{
foreach (var asset in objects)
foreach (var asset in objects.Where(asset => asset))
{
if (asset is null) continue;
if (asset.Packages is null)
asset.Packages = Array.Empty<AssetCollectPackage>();

_Instance = asset;
return _Instance;
}
Expand All @@ -138,11 +139,12 @@ public static AssetCollectRoot GetOrCreate()
/// <param name="isLower">是否小写</param>
/// <param name="hasExtension">是否包含后缀</param>
/// <param name="limitPackage">限制包名 只查找指定包资源 空则忽略</param>
/// <returns>
/// Item1 包名
/// Item2 组名
/// Item3 可寻址路径
/// </returns>
/// <returns> <code>
/// var result = AssetCollectRoot.AssetToAddress();
/// result.Item1 包名
/// result.Item2 组名
/// result.Item3 可寻址路径
/// </code> </returns>
public static Tuple<string, string, string> AssetToAddress(string assetPath, bool isLower, bool hasExtension, string limitPackage = "")
{
if (IsNoAssetPath(assetPath)) return Empty;
Expand Down
2 changes: 1 addition & 1 deletion Editor/Interface/IAssetRuleFilter/IAssetRuleFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface IAssetRuleFilter
/// 显示顺序
/// </summary>
int DisplayIndex { get; }

/// <summary>
/// 验证资源是否符合规则
/// </summary>
Expand Down
Loading
Loading