Skip to content

Commit

Permalink
- Fix missing characters in NotoSansSC-Regular SDF fonts.
Browse files Browse the repository at this point in the history
- Ignore fields' serialization in AC_CharacterAnimatorController.RandomParamInfo.
- Add ground config on AC_DefaultEnvironmentController.
- Add TransparentShadowReceiver shader.
- Update shadow resolution on High UrpPipeline.
  • Loading branch information
wojiuxuihuan committed May 22, 2023
1 parent 5700c21 commit 0ecb878
Show file tree
Hide file tree
Showing 26 changed files with 5,638 additions and 875 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [3.7.0]
- Fix missing characters in NotoSansSC-Regular SDF fonts.
- Ignore fields' serialization in AC_CharacterAnimatorController.RandomParamInfo.
- Add ground config on AC_DefaultEnvironmentController.
- Add TransparentShadowReceiver shader.
- Update shadow resolution on High UrpPipeline.

## [3.6.1]
- Fix error type define about AC_CharacterAnimatorController.RandomParamInfo.defaultValue.

Expand Down
2 changes: 1 addition & 1 deletion ProjectConfig~/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"dependencies": {
"com.threeyes.alivecursor.sdk": "3.6.1",
"com.threeyes.alivecursor.sdk": "3.7.0",
"com.unity.demoteam.hair": "https://github.com/Unity-Technologies/com.unity.demoteam.hair.git#0.10.0-exp.1",
"com.beans.deform": "1.2.1",
"com.coffee.ui-effect": "4.0.0-preview.9",
Expand Down

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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public abstract class BasicData
{
public abstract void CloneTo(ref object other);
public abstract void NotifyValueChanged(BasicDataState state = BasicDataState.Update);
public abstract void ResetToDefaultValue();
public abstract void ClearEvent();
}

Expand Down Expand Up @@ -63,6 +64,8 @@ public virtual TValue ValueForceUpdate
[JsonIgnore]
#endif
public UnityAction<TValue> actionValueChanged;
public UnityAction<TValue> actionValueReset;

#if USE_JsonDotNet
[JsonIgnore]
#endif
Expand Down Expand Up @@ -108,6 +111,13 @@ public override void NotifyValueChanged(BasicDataState state = BasicDataState.Up
actionValueChanged.Execute(Value);
actionValueChangedEx.Execute(Value, state);
}


public override void ResetToDefaultValue()
{
Value = defaultValue;
actionValueReset.Execute(defaultValue);
}
public override void ClearEvent()
{
actionValueChanged = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ public override IDataOption Init(MemberInfo memberInfo, object obj = null)
enumTypeFullName = variableType?.FullName;
return this;
}

/// <summary>
/// 通过传入的枚举类型,自动初始化
/// </summary>
/// <param name="enumType"></param>
/// <returns></returns>
public virtual IDataOption Init(Type enumType)
{
enumTypeFullName = enumType?.FullName;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Threeyes.Data;
using System;
#if USE_NaughtyAttributes
using NaughtyAttributes;
#endif
namespace Threeyes.Persistent
{

/// <summary>
///
///
/// ToDo:
/// -应该从PersistentData_SO中共用大量参数及父类,减少RuntimeEdit得工作量
///
/// Warning:
/// -Type.GetType只能获取已知的类型,因此针对Mod定义的未知的类型,或命名空间外的类型无效(解决办法:搜索:type.gettype from another assembly,结果是建议带上Assembly)
/// -问题是UMod的包,其Assembly名是自定义且可变的(通过Test_脚本可打印,结果如:umod-compiled-86a7224b-13e3-4533-a8f8-1b129c623f9c),要使用该类,只能在运行时组合该objectTypeFullName,或者使用某种Action,让其进行预先处理,替换占位符umod为对应命名空间
/// </summary>
public class PersistentData_Object : PersistentDataBase<object, ObjectEvent, DataOption_Object>
{
public override Type ValueType
{
get
{
return Type.GetType(dataOption.objectTypeFullName);
}
}

/// <summary>
/// Target Script instance in Scene or Asset window
/// </summary>
public UnityEngine.Object target;

}
}

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

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class GifPlayer : MonoBehaviour
public TextureEvent onInitTexture;//设置初始值(如图像比例)
public TextureEvent onUpdateTexture;
public Texture textureOnReset;//重置时需要设置的默认图片,可以为Null
//Runtime
//Runtime
CancellationTokenSource selfCancellationTokenSource;
CancellationTokenRegistration ctr;
int curIndex = 0;
Expand Down Expand Up @@ -92,7 +92,7 @@ public void ResetData()
}
public void ResetUI()
{
onUpdateTexture.Invoke(textureOnReset);//重置UI显示
onUpdateTexture?.Invoke(textureOnReset);//重置UI显示(需要避免onUpdateTexture为null导致报错)
}
void OnDestroy()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using UnityEngine;
using DG.Tweening;
using NaughtyAttributes;
using Newtonsoft.Json;

/// <summary>
/// Function:
Expand Down Expand Up @@ -90,9 +91,9 @@ public class RandomParamInfo
[EnableIf(nameof(changeAtRuntime))] [AllowNesting] public float transitionDuration = 0.2f;//duration for Tween random value, set to zero if you need this

//[Header("Runtime")]
Animator cacheAnimator;
float nextChangeRandomInterval = 5;
float lastChangeRandomTime;
[JsonIgnore] Animator cacheAnimator;
[JsonIgnore] float nextChangeRandomInterval = 5;
[JsonIgnore] float lastChangeRandomTime;

public RandomParamInfo()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public class AC_DefaultEnvironmentController : AC_EnvironmentControllerBase<AC_S

[Header("Reflection")]
[Tooltip("The main ReflectionProbe")] [Required] [SerializeField] protected ReflectionProbe reflectionProbe;

[Header("Others")]
[Tooltip("Ground for receive shadows, Optional")] [SerializeField] protected GameObject goGround;

#endregion

#region Unity Method
Expand All @@ -35,13 +39,15 @@ private void Awake()
Config.actionIsUseLightsChanged += OnIsUseLightsChanged;
Config.actionIsUseReflectionChanged += OnIsUseReflectionChanged;
Config.actionIsUseSkyboxChanged += OnIsUseSkyboxChanged;
Config.actionIsUseGroundChanged += OnIsUseGroundChanged;
Config.actionPersistentChanged += OnPersistentChanged;//Get called at last
}
private void OnDestroy()
{
Config.actionIsUseLightsChanged -= OnIsUseLightsChanged;
Config.actionIsUseReflectionChanged -= OnIsUseReflectionChanged;
Config.actionIsUseSkyboxChanged -= OnIsUseSkyboxChanged;
Config.actionIsUseGroundChanged -= OnIsUseGroundChanged;
Config.actionPersistentChanged -= OnPersistentChanged;
}
#endregion
Expand All @@ -56,11 +62,15 @@ void OnIsUseReflectionChanged(PersistentChangeState persistentChangeState)
void OnIsUseSkyboxChanged(PersistentChangeState persistentChangeState)
{
}
void OnIsUseGroundChanged(PersistentChangeState persistentChangeState)
{
}
void OnPersistentChanged(PersistentChangeState persistentChangeState)
{
SetLights(Config.isUseLights);
SetReflectionProbe(Config.isUseReflection);
SetSkybox(Config.isUseSkybox);
SetGround(Config.isUseGround);
}
#endregion

Expand Down Expand Up @@ -128,6 +138,11 @@ public override void SetSkybox(bool isUse)

base.SetSkybox(isUse);
}

public virtual void SetGround(bool isUse)
{
goGround?.SetActive(isUse);
}
#endregion

#region Utility
Expand Down Expand Up @@ -207,6 +222,7 @@ public class ConfigInfo : AC_SerializableDataBase
[JsonIgnore] public UnityAction<PersistentChangeState> actionIsUseReflectionChanged;
[JsonIgnore] public UnityAction<PersistentChangeState> actionIsUseLightsChanged;
[JsonIgnore] public UnityAction<PersistentChangeState> actionIsUseSkyboxChanged;
[JsonIgnore] public UnityAction<PersistentChangeState> actionIsUseGroundChanged;
[JsonIgnore] public UnityAction<PersistentChangeState> actionPersistentChanged;

public Material SkyboxMaterial { get { return skyboxType == SkyboxType.Default ? defaultSkyboxMaterial : panoramaSkyboxMaterial; } }
Expand Down Expand Up @@ -236,6 +252,9 @@ public class ConfigInfo : AC_SerializableDataBase
[EnableIf(nameof(isUsePanoramicSkybox))] [AllowNesting] [Range(0, 360)] public float panoramaSkyboxRotation = 0;
[HideInInspector] [JsonIgnore] [PersistentDirPath] public string PersistentDirPath;

[Header("Others")]
[PersistentValueChanged(nameof(OnPersistentValueChanged_IsUseGround))] public bool isUseGround = false;



#region Callback
Expand All @@ -251,6 +270,10 @@ void OnPersistentValueChanged_IsUseSkybox(PersistentChangeState persistentChange
{
actionIsUseSkyboxChanged.Execute(persistentChangeState);
}
void OnPersistentValueChanged_IsUseGround(PersistentChangeState persistentChangeState)
{
actionIsUseGroundChanged.Execute(persistentChangeState);
}
void OnPersistentChanged(PersistentChangeState persistentChangeState)
{
actionPersistentChanged.Execute(persistentChangeState);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Threeyes.Data;
using UnityEngine;
using UnityEngine.SceneManagement;
Expand Down Expand Up @@ -162,13 +163,21 @@ public class AC_CommonSettingConfigInfo : AC_SettingConfigInfoBase<AC_CommonSett
public BoolData generalSetting_IsRunAtStartUp = new BoolData(false);//系统运行时自动启动
public BoolData generalSetting_IsSupportMultiDisplay = new BoolData(true);//支持多屏幕
public BoolData generalSetting_IsVSyncActive = new BoolData(true);//垂直同步(打开可以减少电脑发热现象及减少使用率;高屏幕刷新率的用户关闭以增加流畅度 )
public IntData generalSetting_TargetFrameRate = new IntData(90, new DataOption_Int(true, 60, 360));//垂直同步关闭后的默认帧率(设置为120可以增加流畅度,有需要的可以自行设置)(Todo:暴露在UI中)
public IntData generalSetting_TargetFrameRate = new IntData(125, new DataOption_Int(true, 60, 360));//垂直同步关闭后的默认帧率(设置为鼠标默认采样率125可以增加流畅度,有需要的可以自行设置)(Todo:暴露在UI中)
public StringData generalSetting_Localization = new StringData("English");
public StringData generalSetting_Quality = new StringData("Ultra");
public StringData generalSetting_ProcessPriority = new StringData("High");
public StringData generalSetting_Hotkeys_OpenBrowser = new StringData("");
public StringData generalSetting_Hotkeys_OpenSetting = new StringData("");

public AC_CommonSettingConfigInfo() { }


public override List<BasicData> GetListBaseData_Reset()
{
//忽略多语言
return GetListBaseData(new List<string>() { nameof(generalSetting_Localization) });

}
}
#endregion
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public virtual void Init(bool isFirstInit)
InitEvent();//监听Config事件
InitUI();//基于Config初始化UI

Config.NotifyAllDataEvent(BasicDataState.Init);//#外部已经监听完毕,且值已经设置完毕,通知所有监听BaseData的方法,从而进行初始化
hasInit = true;
}
public virtual void DeInit()
Expand All @@ -51,7 +50,8 @@ public virtual void InitEvent()
}
public virtual void ResetConfigToDefault()
{

//重置配置为默认值
Config.ResetAllDataToDefault();
}

protected virtual void UpdateConfig(bool isFirstInit)
Expand Down Expand Up @@ -83,39 +83,41 @@ public abstract class AC_SettingConfigInfoBase<TRealType> : AC_SerializableDataB
{
public Version version = new Version("3.0");//Warning:格式必须是A.B,否则报错!(The major and minor components are required; the build and revision components are optional)

public void ClearAllDataEvent()
public virtual void ResetAllDataToDefault()
{
///Todo:使用默认值进行重置,同时会调用actionValueReset从而静默更新UI
try
{
GetListBaseData().ForEach((bd) => bd.ClearEvent());
GetListBaseData_Reset().ForEach((bd) =>
bd.ResetToDefaultValue());
}
catch (Exception e)
{
Debug.LogError("ClearAllDataEvent with error:\r\n" + e);
Debug.LogError("ResetAllData with error:\r\n" + e);
}
}
public void NotifyAllDataEvent(BasicDataState state = BasicDataState.Update)
public void ClearAllDataEvent()
{
try
{
GetListBaseData().ForEach((bd) =>
{
try
{
bd.NotifyValueChanged(state);
}
catch (Exception e)
{
Debug.LogError($"NotifyAllDataEvent {bd} on state {state} with error:\r\n" + e);
}
});
GetListBaseData().ForEach((bd) => bd.ClearEvent());
}
catch (Exception e)
{
Debug.LogError("ClearAllDataEvent with error:\r\n" + e);
}
}


public virtual List<BasicData> GetListBaseData_Reset()
{
return GetListBaseData();
}
/// <summary>
/// 获取所有的数据类实例
/// </summary>
/// <returns></returns>
public List<BasicData> GetListBaseData()
public List<BasicData> GetListBaseData(List<string> listIgnoreFieldName = null)
{
List<BasicData> listBD = new List<BasicData>();

Expand All @@ -125,6 +127,10 @@ public List<BasicData> GetListBaseData()
var fieldValue = fieldInfo.GetValue(this);//真实值
if (fieldValue.GetType().IsSubclassOf(typeof(BasicData)))
{
if (listIgnoreFieldName != null && listIgnoreFieldName.Contains(fieldInfo.Name))//忽略指定字段
{
continue;
}
BasicData inst = fieldValue as BasicData;
listBD.Add(inst);
}
Expand Down
3 changes: 2 additions & 1 deletion Threeyes/SDK/Scripts/Editor/AC_ItemManagerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ private void OnPlayGifToggleChanged(ChangeEvent<bool> evt)
private void OnAgreementLabelClick(ClickEvent evt)
{
//https://partner.steamgames.com/doc/features/workshop/implementation#Legal
//string urlPath = "steam://url/CommunityFilePage/" +curSOWorkshopItemInfo.ItemID;//打开Item对应页面
// string agreementUrlPath=https://steamcommunity.com/sharedfiles/workshoplegalagreement;
//string urlPath = "steam://url/CommunityFilePage/" + curSOWorkshopItemInfo.ItemID;//打开Item对应页面
Application.OpenURL("https://steamcommunity.com/sharedfiles/workshoplegalagreement");

}
Expand Down
1 change: 1 addition & 0 deletions Threeyes/SDK/Scripts/Tool/AC_WorkshopItemTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static ulong GetId(string itemDirPath)
// 主Url
public static string GetUrl(ulong itemId, bool isOpenViaWeb = true)
{
//"steam://url/CommunityFilePage/" + itemId//PS:需要调用Steam
return GetUrlFunc("http://steamcommunity.com/sharedfiles/filedetails/?id=", itemId, isOpenViaWeb);
}
public static string GetChangeLogUrl(ulong itemId, bool isOpenViaWeb = true)
Expand Down
8 changes: 8 additions & 0 deletions Threeyes/SDK/Shaders/TransparentShadowReceiver.meta

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

1 change: 1 addition & 0 deletions Threeyes/SDK/Shaders/TransparentShadowReceiver/#Source.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/Unity-Technologies/arfoundation-demos/tree/master/Assets/Shaders/Shadows/ShaderGraphs
Loading

0 comments on commit 0ecb878

Please sign in to comment.