Skip to content
Merged
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
23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE/bug-report---bug反馈.md

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/auto_gen_toc.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Publish on Tag
on:
release:
types: [published]
jobs:
call-publish:
if: github.actor != 'perotoolsbot[bot]'
uses: peroperogames/ToolsWorkflow/.github/workflows/publish-npm.yml@main
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: AI Code Review
on:
pull_request:
types: [opened, synchronize, reopened, closed]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
review:
if: github.actor != 'perotoolsbot[bot]'
uses: peroperogames/ToolsWorkflow/.github/workflows/code-review.yml@main
secrets: inherit
19 changes: 19 additions & 0 deletions Editor/Helper/PresetHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) Jason Ma
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
Expand All @@ -9,10 +10,20 @@ public class PresetHelper
{
private static Dictionary<string /*FileName*/, LwguiShaderPropertyPreset> _loadedPresets = new Dictionary<string, LwguiShaderPropertyPreset>();

private static readonly string _domainKey = "ShaderPropertyPresetStorageDomainHash";
private static bool _isInitComplete;

public static bool IsInitComplete { get { return _isInitComplete; } }

[InitializeOnLoadMethod]
private static void StorageDomainHash()
{
EditorApplication.delayCall += () =>
{
SessionState.SetString(_domainKey, AppDomain.CurrentDomain.GetHashCode().ToString());
};
}

public static void Init()
{
if (!_isInitComplete)
Expand Down Expand Up @@ -52,6 +63,14 @@ public static LwguiShaderPropertyPreset GetPresetAsset(string presetFileName)
if (string.IsNullOrEmpty(presetFileName))
return null;

// 在某些域下,静态变量的缓存会有问题,而且无法找到Packages下的Preset,所以忽略
var domainHash = AppDomain.CurrentDomain.GetHashCode().ToString();
var expectedDomainHash = SessionState.GetString(_domainKey, string.Empty);
if (string.IsNullOrEmpty(expectedDomainHash) || !domainHash.Equals(expectedDomainHash))
{
return null;
}

if (!_loadedPresets.ContainsKey(presetFileName) || !_loadedPresets[presetFileName])
ForceInit();

Expand Down
8 changes: 8 additions & 0 deletions ShaderPropertyPreset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

239 changes: 239 additions & 0 deletions ShaderPropertyPreset/SPP_BlendModePreset.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 28fbcbca3fb14507af6ed5c104c40b84, type: 3}
m_Name: SPP_BlendModePreset
m_EditorClassIdentifier:
presets:
- presetName: "\u9ED8\u8BA4"
propertyValues:
- propertyName: _SrcBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _DstBlend
propertyType: 2
floatValue: 10
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _BlendOp
propertyType: 2
floatValue: 0
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
enabledKeywords: []
disabledKeywords: []
enabledPasses: []
disabledPasses: []
renderQueue: -1
- presetName: "\u7C7B\u6EE4\u955C"
propertyValues:
- propertyName: _SrcBlend
propertyType: 2
floatValue: 5
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _DstBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _BlendOp
propertyType: 2
floatValue: 0
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
enabledKeywords: []
disabledKeywords: []
enabledPasses: []
disabledPasses: []
renderQueue: -1
- presetName: "\u7C7B\u6B63\u7247\u53E0\u5E95"
propertyValues:
- propertyName: _SrcBlend
propertyType: 2
floatValue: 2
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _DstBlend
propertyType: 2
floatValue: 10
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _BlendOp
propertyType: 2
floatValue: 0
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
enabledKeywords: []
disabledKeywords: []
enabledPasses: []
disabledPasses: []
renderQueue: -1
- presetName: "\u7C7B\u7EBF\u6027\u51CF\u6DE1"
propertyValues:
- propertyName: _SrcBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _DstBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _BlendOp
propertyType: 2
floatValue: 0
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
enabledKeywords: []
disabledKeywords: []
enabledPasses: []
disabledPasses: []
renderQueue: -1
- presetName: "\u7C7B\u53D8\u6697"
propertyValues:
- propertyName: _SrcBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _DstBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _BlendOp
propertyType: 2
floatValue: 3
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
enabledKeywords: []
disabledKeywords: []
enabledPasses: []
disabledPasses: []
renderQueue: -1
- presetName: "\u7C7B\u53D8\u4EAE"
propertyValues:
- propertyName: _SrcBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _DstBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _BlendOp
propertyType: 2
floatValue: 4
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
enabledKeywords: []
disabledKeywords: []
enabledPasses: []
disabledPasses: []
renderQueue: -1
- presetName: "\u51CF\u6CD5"
propertyValues:
- propertyName: _SrcBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _DstBlend
propertyType: 2
floatValue: 1
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _BlendOp
propertyType: 2
floatValue: 2
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
enabledKeywords: []
disabledKeywords: []
enabledPasses: []
disabledPasses: []
renderQueue: -1
- presetName: "\u666E\u901A\u900F\u660E"
propertyValues:
- propertyName: _SrcBlend
propertyType: 2
floatValue: 5
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _DstBlend
propertyType: 2
floatValue: 10
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
- propertyName: _BlendOp
propertyType: 2
floatValue: 0
intValue: 0
colorValue: {r: 0, g: 0, b: 0, a: 0}
vectorValue: {x: 0, y: 0, z: 0, w: 0}
textureValue: {fileID: 0}
enabledKeywords: []
disabledKeywords: []
enabledPasses: []
disabledPasses: []
renderQueue: -1
8 changes: 8 additions & 0 deletions ShaderPropertyPreset/SPP_BlendModePreset.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading