优化侧边栏菜单 UI细节

This commit is contained in:
ALIENJACK 2024-12-04 23:15:05 +08:00
parent 0b7d6c640d
commit 31099c1900
81 changed files with 6544 additions and 5445 deletions

View File

@ -1,5 +1,4 @@
using AxibugEmuOnline.Client; using AxibugEmuOnline.Client;
using System;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
namespace AxibugEmuOnline.Editors namespace AxibugEmuOnline.Editors

View File

@ -1,6 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using UnityEngine;
namespace AxiReplay namespace AxiReplay
{ {

View File

@ -1,6 +1,6 @@
using UnityEngine; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine;
namespace Coffee.UIExtensions namespace Coffee.UIExtensions
{ {

View File

@ -1,6 +1,6 @@
#if UNITY_EDITOR #if UNITY_EDITOR
using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using UnityEditor; using UnityEditor;

View File

@ -1,6 +1,4 @@
using System.Collections; using UnityEngine;
using System.Collections.Generic;
using UnityEngine;
public static class Packer public static class Packer
{ {

View File

@ -1,8 +1,6 @@
using System.Collections; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.Rendering;
using System;
namespace Coffee.UIExtensions namespace Coffee.UIExtensions
{ {

View File

@ -1,5 +1,4 @@
using System.Collections; using System.Collections.Generic;
using System.Collections.Generic;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;

View File

@ -1,10 +1,8 @@
using System.Collections; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using UnityEditor; using UnityEditor;
using UnityEngine;
namespace Coffee.UIExtensions.Editors namespace Coffee.UIExtensions.Editors
{ {

View File

@ -1,9 +1,6 @@
using UnityEditor; using System.Linq;
using UnityEditorInternal; using UnityEditor;
using UnityEngine; using UnityEngine;
using System.Linq;
using System.Collections.Generic;
using UnityEngine.UI;
namespace Coffee.UIExtensions.Editors namespace Coffee.UIExtensions.Editors
{ {
@ -139,7 +136,8 @@ namespace Coffee.UIExtensions.Editors
} }
var c = target as UIDissolve; var c = target as UIDissolve;
c.ShowTMProWarning (_shader, _mobileShader, _spriteShader, mat => { c.ShowTMProWarning(_shader, _mobileShader, _spriteShader, mat =>
{
if (mat.shader == _spriteShader) if (mat.shader == _spriteShader)
{ {
mat.shaderKeywords = c.material.shaderKeywords; mat.shaderKeywords = c.material.shaderKeywords;

View File

@ -1,8 +1,7 @@
using UnityEditor; using System;
using UnityEditorInternal;
using UnityEngine;
using System.Linq; using System.Linq;
using System; using UnityEditor;
using UnityEngine;
namespace Coffee.UIExtensions.Editors namespace Coffee.UIExtensions.Editors
{ {
@ -59,7 +58,8 @@ namespace Coffee.UIExtensions.Editors
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
SerializedProperty spColor = serializedObject.FindProperty(colorProperty); SerializedProperty spColor = serializedObject.FindProperty(colorProperty);
if (spColor == null && serializedObject.targetObject is UIEffect) { if (spColor == null && serializedObject.targetObject is UIEffect)
{
spColor = new SerializedObject(serializedObject.targetObjects.Select(x => (x as UIEffect).targetGraphic).ToArray()).FindProperty(colorProperty); spColor = new SerializedObject(serializedObject.targetObjects.Select(x => (x as UIEffect).targetGraphic).ToArray()).FindProperty(colorProperty);
} }
@ -70,7 +70,8 @@ namespace Coffee.UIExtensions.Editors
#else #else
spColor.colorValue = EditorGUILayout.ColorField (contentEffectColor, spColor.colorValue, true, false, false, null); spColor.colorValue = EditorGUILayout.ColorField (contentEffectColor, spColor.colorValue, true, false, false, null);
#endif #endif
if (EditorGUI.EndChangeCheck ()) { if (EditorGUI.EndChangeCheck())
{
spColor.serializedObject.ApplyModifiedProperties(); spColor.serializedObject.ApplyModifiedProperties();
} }
@ -182,7 +183,8 @@ namespace Coffee.UIExtensions.Editors
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
SerializedProperty spColor = serializedObject.FindProperty("m_Color"); SerializedProperty spColor = serializedObject.FindProperty("m_Color");
if (spColor == null && serializedObject.targetObject is UIEffect) { if (spColor == null && serializedObject.targetObject is UIEffect)
{
spColor = new SerializedObject(serializedObject.targetObjects.Select(x => (x as UIEffect).targetGraphic).ToArray()).FindProperty(!isAnyTMPro ? "m_Color" : "m_fontColor"); spColor = new SerializedObject(serializedObject.targetObjects.Select(x => (x as UIEffect).targetGraphic).ToArray()).FindProperty(!isAnyTMPro ? "m_Color" : "m_fontColor");
} }
@ -193,7 +195,8 @@ namespace Coffee.UIExtensions.Editors
#else #else
spColor.colorValue = EditorGUILayout.ColorField (contentEffectColor, spColor.colorValue, true, false, false, null); spColor.colorValue = EditorGUILayout.ColorField (contentEffectColor, spColor.colorValue, true, false, false, null);
#endif #endif
if (EditorGUI.EndChangeCheck ()) { if (EditorGUI.EndChangeCheck())
{
spColor.serializedObject.ApplyModifiedProperties(); spColor.serializedObject.ApplyModifiedProperties();
} }

View File

@ -1,6 +1,5 @@
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIExtensions.Editors namespace Coffee.UIExtensions.Editors
{ {

View File

@ -1,7 +1,5 @@
using UnityEditor; using UnityEditor;
using UnityEditorInternal;
using UnityEngine; using UnityEngine;
using System.Linq;
namespace Coffee.UIExtensions.Editors namespace Coffee.UIExtensions.Editors
{ {

View File

@ -1,6 +1,4 @@
using UnityEditor; using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
namespace Coffee.UIExtensions.Editors namespace Coffee.UIExtensions.Editors
{ {

View File

@ -1,7 +1,5 @@
using UnityEditor; using UnityEditor;
using UnityEditorInternal;
using UnityEngine; using UnityEngine;
using System.Linq;
namespace Coffee.UIExtensions.Editors namespace Coffee.UIExtensions.Editors
{ {

View File

@ -1,7 +1,6 @@
using UnityEditor; using System.Linq;
using UnityEditorInternal; using UnityEditor;
using UnityEngine; using UnityEngine;
using System.Linq;
namespace Coffee.UIExtensions.Editors namespace Coffee.UIExtensions.Editors
{ {

View File

@ -1,7 +1,7 @@
using System; using System;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Serialization; using UnityEngine.Serialization;
using UnityEngine.UI;
namespace Coffee.UIExtensions namespace Coffee.UIExtensions
{ {
@ -55,9 +55,11 @@ namespace Coffee.UIExtensions
[SerializeField] bool m_Reverse = false; [SerializeField] bool m_Reverse = false;
#pragma warning disable 0414 #pragma warning disable 0414
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField][Range(0.1f, 10)] float m_Duration = 1; [SerializeField][Range(0.1f, 10)] float m_Duration = 1;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] AnimatorUpdateMode m_UpdateMode = AnimatorUpdateMode.Normal; [SerializeField] AnimatorUpdateMode m_UpdateMode = AnimatorUpdateMode.Normal;
#pragma warning restore 0414 #pragma warning restore 0414

View File

@ -5,7 +5,6 @@ using UnityEngine.UI;
using UnityEngine.Serialization; using UnityEngine.Serialization;
#if UNITY_EDITOR #if UNITY_EDITOR
using System.IO;
using System.Linq; using System.Linq;
using UnityEditor; using UnityEditor;
#endif #endif
@ -56,19 +55,26 @@ namespace Coffee.UIExtensions
[SerializeField] bool m_AdvancedBlur = false; [SerializeField] bool m_AdvancedBlur = false;
#pragma warning disable 0414 #pragma warning disable 0414
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField][Range(0, 1)] float m_ShadowBlur = 1; [SerializeField][Range(0, 1)] float m_ShadowBlur = 1;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] ShadowStyle m_ShadowStyle; [SerializeField] ShadowStyle m_ShadowStyle;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] Color m_ShadowColor = Color.black; [SerializeField] Color m_ShadowColor = Color.black;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] Vector2 m_EffectDistance = new Vector2(1f, -1f); [SerializeField] Vector2 m_EffectDistance = new Vector2(1f, -1f);
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] bool m_UseGraphicAlpha = true; [SerializeField] bool m_UseGraphicAlpha = true;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] Color m_EffectColor = Color.white; [SerializeField] Color m_EffectColor = Color.white;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] List<UIShadow.AdditionalShadow> m_AdditionalShadows = new List<UIShadow.AdditionalShadow>(); [SerializeField] List<UIShadow.AdditionalShadow> m_AdditionalShadows = new List<UIShadow.AdditionalShadow>();
#pragma warning restore 0414 #pragma warning restore 0414

View File

@ -1,8 +1,8 @@
using System.Collections; using System.Collections;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.Rendering; using UnityEngine.Rendering;
using UnityEngine.Serialization;
using UnityEngine.UI; using UnityEngine.UI;
namespace Coffee.UIExtensions namespace Coffee.UIExtensions

View File

@ -1,6 +1,4 @@
using System; using UnityEngine;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
namespace Coffee.UIExtensions namespace Coffee.UIExtensions

View File

@ -1,5 +1,4 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI; using UnityEngine.UI;

View File

@ -5,8 +5,6 @@ using UnityEngine.Serialization;
using UnityEngine.UI; using UnityEngine.UI;
#if UNITY_EDITOR #if UNITY_EDITOR
using System.IO;
using System.Linq;
using UnityEditor; using UnityEditor;
#endif #endif
@ -70,7 +68,8 @@ namespace Coffee.UIExtensions
[SerializeField] ShadowStyle m_Style = ShadowStyle.Shadow; [SerializeField] ShadowStyle m_Style = ShadowStyle.Shadow;
#pragma warning disable 0414 #pragma warning disable 0414
[HideInInspector][System.Obsolete] [HideInInspector]
[System.Obsolete]
[SerializeField] List<AdditionalShadow> m_AdditionalShadows = new List<AdditionalShadow>(); [SerializeField] List<AdditionalShadow> m_AdditionalShadows = new List<AdditionalShadow>();
#pragma warning restore 0414 #pragma warning restore 0414

View File

@ -1,14 +1,9 @@
using System; using System;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.Serialization; using UnityEngine.Serialization;
using UnityEngine.UI; using UnityEngine.UI;
using System.Collections;
#if UNITY_EDITOR #if UNITY_EDITOR
using System.IO;
using System.Linq;
using UnityEditor;
#endif #endif
namespace Coffee.UIExtensions namespace Coffee.UIExtensions
@ -57,15 +52,20 @@ namespace Coffee.UIExtensions
[SerializeField] EffectPlayer m_Player; [SerializeField] EffectPlayer m_Player;
#pragma warning disable 0414 #pragma warning disable 0414
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] bool m_Play = false; [SerializeField] bool m_Play = false;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] bool m_Loop = false; [SerializeField] bool m_Loop = false;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField][Range(0.1f, 10)] float m_Duration = 1; [SerializeField][Range(0.1f, 10)] float m_Duration = 1;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField][Range(0, 10)] float m_LoopDelay = 1; [SerializeField][Range(0, 10)] float m_LoopDelay = 1;
[Obsolete][HideInInspector] [Obsolete]
[HideInInspector]
[SerializeField] AnimatorUpdateMode m_UpdateMode = AnimatorUpdateMode.Normal; [SerializeField] AnimatorUpdateMode m_UpdateMode = AnimatorUpdateMode.Normal;
#pragma warning restore 0414 #pragma warning restore 0414

View File

@ -1,6 +1,5 @@
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using UnityEngine.Serialization;
namespace Coffee.UIExtensions namespace Coffee.UIExtensions
{ {

View File

@ -2,7 +2,6 @@
// Created: 2018/07/13 // Created: 2018/07/13
#if true // MODULE_MARKER #if true // MODULE_MARKER
using System;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Plugins.Options; using DG.Tweening.Plugins.Options;
using UnityEngine; using UnityEngine;
@ -50,7 +49,8 @@ namespace DG.Tweening
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param> /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static TweenerCore<float, float, FloatOptions> DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration) public static TweenerCore<float, float, FloatOptions> DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration)
{ {
TweenerCore<float, float, FloatOptions> t = DOTween.To(()=> { TweenerCore<float, float, FloatOptions> t = DOTween.To(() =>
{
float currVal; float currVal;
target.GetFloat(floatName, out currVal); target.GetFloat(floatName, out currVal);
return currVal; return currVal;

View File

@ -1,6 +1,4 @@
using UnityEngine; #if false || EPO_DOTWEEN // MODULE_MARKER
#if false || EPO_DOTWEEN // MODULE_MARKER
using EPOOutline; using EPOOutline;
using DG.Tweening.Plugins.Options; using DG.Tweening.Plugins.Options;

View File

@ -2,7 +2,6 @@
// Created: 2018/07/13 // Created: 2018/07/13
#if true // MODULE_MARKER #if true // MODULE_MARKER
using System;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Core.Enums; using DG.Tweening.Core.Enums;
using DG.Tweening.Plugins; using DG.Tweening.Plugins;
@ -116,8 +115,10 @@ namespace DG.Tweening
.SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear) .SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear)
).Join(yTween) ).Join(yTween)
.SetTarget(target).SetEase(DOTween.defaultEaseType); .SetTarget(target).SetEase(DOTween.defaultEaseType);
yTween.OnUpdate(() => { yTween.OnUpdate(() =>
if (!offsetYSet) { {
if (!offsetYSet)
{
offsetYSet = true; offsetYSet = true;
offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
} }

View File

@ -2,7 +2,6 @@
// Created: 2018/07/13 // Created: 2018/07/13
#if true // MODULE_MARKER #if true // MODULE_MARKER
using System;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Plugins; using DG.Tweening.Plugins;
using DG.Tweening.Plugins.Core.PathCore; using DG.Tweening.Plugins.Core.PathCore;
@ -87,8 +86,10 @@ namespace DG.Tweening
.SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
).Join(yTween) ).Join(yTween)
.SetTarget(target).SetEase(DOTween.defaultEaseType); .SetTarget(target).SetEase(DOTween.defaultEaseType);
yTween.OnUpdate(() => { yTween.OnUpdate(() =>
if (!offsetYSet) { {
if (!offsetYSet)
{
offsetYSet = true; offsetYSet = true;
offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
} }

View File

@ -2,10 +2,9 @@
// Created: 2018/07/13 // Created: 2018/07/13
#if true // MODULE_MARKER #if true // MODULE_MARKER
using System;
using UnityEngine;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Plugins.Options; using DG.Tweening.Plugins.Options;
using UnityEngine;
#pragma warning disable 1591 #pragma warning disable 1591
namespace DG.Tweening namespace DG.Tweening
@ -45,9 +44,11 @@ namespace DG.Tweening
Sequence s = DOTween.Sequence(); Sequence s = DOTween.Sequence();
GradientColorKey[] colors = gradient.colorKeys; GradientColorKey[] colors = gradient.colorKeys;
int len = colors.Length; int len = colors.Length;
for (int i = 0; i < len; ++i) { for (int i = 0; i < len; ++i)
{
GradientColorKey c = colors[i]; GradientColorKey c = colors[i];
if (i == 0 && c.time <= 0) { if (i == 0 && c.time <= 0)
{
target.color = c.color; target.color = c.color;
continue; continue;
} }
@ -75,7 +76,8 @@ namespace DG.Tweening
{ {
endValue = endValue - target.color; endValue = endValue - target.color;
Color to = new Color(0, 0, 0, 0); Color to = new Color(0, 0, 0, 0);
return DOTween.To(() => to, x => { return DOTween.To(() => to, x =>
{
Color diff = x - to; Color diff = x - to;
to = x; to = x;
target.color += diff; target.color += diff;

View File

@ -3,14 +3,13 @@
#if true // MODULE_MARKER #if true // MODULE_MARKER
using System;
using System.Globalization;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Core.Enums; using DG.Tweening.Core.Enums;
using DG.Tweening.Plugins; using DG.Tweening.Plugins;
using DG.Tweening.Plugins.Options; using DG.Tweening.Plugins.Options;
using System.Globalization;
using UnityEngine;
using UnityEngine.UI;
using Outline = UnityEngine.UI.Outline; using Outline = UnityEngine.UI.Outline;
using Text = UnityEngine.UI.Text; using Text = UnityEngine.UI.Text;
@ -102,9 +101,11 @@ namespace DG.Tweening
Sequence s = DOTween.Sequence(); Sequence s = DOTween.Sequence();
GradientColorKey[] colors = gradient.colorKeys; GradientColorKey[] colors = gradient.colorKeys;
int len = colors.Length; int len = colors.Length;
for (int i = 0; i < len; ++i) { for (int i = 0; i < len; ++i)
{
GradientColorKey c = colors[i]; GradientColorKey c = colors[i];
if (i == 0 && c.time <= 0) { if (i == 0 && c.time <= 0)
{
target.color = c.color; target.color = c.color;
continue; continue;
} }
@ -127,7 +128,8 @@ namespace DG.Tweening
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param> /// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) public static TweenerCore<Vector2, Vector2, VectorOptions> DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
{ {
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x => { TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x =>
{
target.flexibleWidth = x.x; target.flexibleWidth = x.x;
target.flexibleHeight = x.y; target.flexibleHeight = x.y;
}, endValue, duration); }, endValue, duration);
@ -141,7 +143,8 @@ namespace DG.Tweening
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param> /// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) public static TweenerCore<Vector2, Vector2, VectorOptions> DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
{ {
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x => { TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x =>
{
target.minWidth = x.x; target.minWidth = x.x;
target.minHeight = x.y; target.minHeight = x.y;
}, endValue, duration); }, endValue, duration);
@ -155,7 +158,8 @@ namespace DG.Tweening
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param> /// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) public static TweenerCore<Vector2, Vector2, VectorOptions> DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
{ {
TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x => { TweenerCore<Vector2, Vector2, VectorOptions> t = DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x =>
{
target.preferredWidth = x.x; target.preferredWidth = x.x;
target.preferredHeight = x.y; target.preferredHeight = x.y;
}, endValue, duration); }, endValue, duration);
@ -409,8 +413,10 @@ namespace DG.Tweening
.SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
).Join(yTween) ).Join(yTween)
.SetTarget(target).SetEase(DOTween.defaultEaseType); .SetTarget(target).SetEase(DOTween.defaultEaseType);
s.OnUpdate(() => { s.OnUpdate(() =>
if (!offsetYSet) { {
if (!offsetYSet)
{
offsetYSet = true; offsetYSet = true;
offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
} }
@ -434,7 +440,8 @@ namespace DG.Tweening
public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false) public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false)
{ {
return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition), return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition),
x => { x =>
{
target.horizontalNormalizedPosition = x.x; target.horizontalNormalizedPosition = x.x;
target.verticalNormalizedPosition = x.y; target.verticalNormalizedPosition = x.y;
}, endValue, duration) }, endValue, duration)
@ -498,10 +505,12 @@ namespace DG.Tweening
/// <param name="culture">The <see cref="CultureInfo"/> to use (InvariantCulture if NULL)</param> /// <param name="culture">The <see cref="CultureInfo"/> to use (InvariantCulture if NULL)</param>
public static TweenerCore<int, int, NoOptions> DOCounter( public static TweenerCore<int, int, NoOptions> DOCounter(
this Text target, int fromValue, int endValue, float duration, bool addThousandsSeparator = true, CultureInfo culture = null this Text target, int fromValue, int endValue, float duration, bool addThousandsSeparator = true, CultureInfo culture = null
){ )
{
int v = fromValue; int v = fromValue;
CultureInfo cInfo = !addThousandsSeparator ? null : culture ?? CultureInfo.InvariantCulture; CultureInfo cInfo = !addThousandsSeparator ? null : culture ?? CultureInfo.InvariantCulture;
TweenerCore<int, int, NoOptions> t = DOTween.To(() => v, x => { TweenerCore<int, int, NoOptions> t = DOTween.To(() => v, x =>
{
v = x; v = x;
target.text = addThousandsSeparator target.text = addThousandsSeparator
? v.ToString("N0", cInfo) ? v.ToString("N0", cInfo)
@ -532,7 +541,8 @@ namespace DG.Tweening
/// Leave it to NULL (default) to use default ones</param> /// Leave it to NULL (default) to use default ones</param>
public static TweenerCore<string, string, StringOptions> DOText(this Text target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null) public static TweenerCore<string, string, StringOptions> DOText(this Text target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null)
{ {
if (endValue == null) { if (endValue == null)
{
if (Debugger.logPriority > 0) Debugger.LogWarning("You can't pass a NULL string to DOText: an empty string will be used instead to avoid errors"); if (Debugger.logPriority > 0) Debugger.LogWarning("You can't pass a NULL string to DOText: an empty string will be used instead to avoid errors");
endValue = ""; endValue = "";
} }
@ -557,7 +567,8 @@ namespace DG.Tweening
{ {
endValue = endValue - target.color; endValue = endValue - target.color;
Color to = new Color(0, 0, 0, 0); Color to = new Color(0, 0, 0, 0);
return DOTween.To(() => to, x => { return DOTween.To(() => to, x =>
{
Color diff = x - to; Color diff = x - to;
to = x; to = x;
target.color += diff; target.color += diff;
@ -578,7 +589,8 @@ namespace DG.Tweening
{ {
endValue = endValue - target.color; endValue = endValue - target.color;
Color to = new Color(0, 0, 0, 0); Color to = new Color(0, 0, 0, 0);
return DOTween.To(() => to, x => { return DOTween.To(() => to, x =>
{
Color diff = x - to; Color diff = x - to;
to = x; to = x;
target.color += diff; target.color += diff;
@ -599,7 +611,8 @@ namespace DG.Tweening
{ {
endValue = endValue - target.color; endValue = endValue - target.color;
Color to = new Color(0, 0, 0, 0); Color to = new Color(0, 0, 0, 0);
return DOTween.To(() => to, x => { return DOTween.To(() => to, x =>
{
Color diff = x - to; Color diff = x - to;
to = x; to = x;
target.color += diff; target.color += diff;

View File

@ -1,10 +1,9 @@
// Author: Daniele Giardini - http://www.demigiant.com // Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/13 // Created: 2018/07/13
using System;
using UnityEngine;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Plugins.Options; using DG.Tweening.Plugins.Options;
using UnityEngine;
//#if UNITY_2018_1_OR_NEWER && (NET_4_6 || NET_STANDARD_2_0) //#if UNITY_2018_1_OR_NEWER && (NET_4_6 || NET_STANDARD_2_0)
//using Task = System.Threading.Tasks.Task; //using Task = System.Threading.Tasks.Task;
//#endif //#endif
@ -29,9 +28,11 @@ namespace DG.Tweening
Sequence s = DOTween.Sequence(); Sequence s = DOTween.Sequence();
GradientColorKey[] colors = gradient.colorKeys; GradientColorKey[] colors = gradient.colorKeys;
int len = colors.Length; int len = colors.Length;
for (int i = 0; i < len; ++i) { for (int i = 0; i < len; ++i)
{
GradientColorKey c = colors[i]; GradientColorKey c = colors[i];
if (i == 0 && c.time <= 0) { if (i == 0 && c.time <= 0)
{
target.color = c.color; target.color = c.color;
continue; continue;
} }
@ -54,9 +55,11 @@ namespace DG.Tweening
Sequence s = DOTween.Sequence(); Sequence s = DOTween.Sequence();
GradientColorKey[] colors = gradient.colorKeys; GradientColorKey[] colors = gradient.colorKeys;
int len = colors.Length; int len = colors.Length;
for (int i = 0; i < len; ++i) { for (int i = 0; i < len; ++i)
{
GradientColorKey c = colors[i]; GradientColorKey c = colors[i];
if (i == 0 && c.time <= 0) { if (i == 0 && c.time <= 0)
{
target.SetColor(property, c.color); target.SetColor(property, c.color);
continue; continue;
} }
@ -80,7 +83,8 @@ namespace DG.Tweening
/// </summary> /// </summary>
public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction) public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null; return null;
} }
@ -94,7 +98,8 @@ namespace DG.Tweening
/// </summary> /// </summary>
public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction) public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null; return null;
} }
@ -108,7 +113,8 @@ namespace DG.Tweening
/// </summary> /// </summary>
public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction) public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null; return null;
} }
@ -123,7 +129,8 @@ namespace DG.Tweening
/// <param name="elapsedLoops">Elapsed loops to wait for</param> /// <param name="elapsedLoops">Elapsed loops to wait for</param>
public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction) public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null; return null;
} }
@ -139,7 +146,8 @@ namespace DG.Tweening
/// <param name="position">Position (loops included, delays excluded) to wait for</param> /// <param name="position">Position (loops included, delays excluded) to wait for</param>
public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction) public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null; return null;
} }
@ -154,7 +162,8 @@ namespace DG.Tweening
/// </summary> /// </summary>
public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction) public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return null; return null;
} }
@ -175,7 +184,8 @@ namespace DG.Tweening
/// <param name="duration">The duration of the tween</param> /// <param name="duration">The duration of the tween</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOOffset(this Material target, Vector2 endValue, int propertyID, float duration) public static TweenerCore<Vector2, Vector2, VectorOptions> DOOffset(this Material target, Vector2 endValue, int propertyID, float duration)
{ {
if (!target.HasProperty(propertyID)) { if (!target.HasProperty(propertyID))
{
if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID); if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
return null; return null;
} }
@ -191,7 +201,8 @@ namespace DG.Tweening
/// <param name="duration">The duration of the tween</param> /// <param name="duration">The duration of the tween</param>
public static TweenerCore<Vector2, Vector2, VectorOptions> DOTiling(this Material target, Vector2 endValue, int propertyID, float duration) public static TweenerCore<Vector2, Vector2, VectorOptions> DOTiling(this Material target, Vector2 endValue, int propertyID, float duration)
{ {
if (!target.HasProperty(propertyID)) { if (!target.HasProperty(propertyID))
{
if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID); if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID);
return null; return null;
} }
@ -215,7 +226,8 @@ namespace DG.Tweening
/// </summary> /// </summary>
public static async System.Threading.Tasks.Task AsyncWaitForCompletion(this Tween t) public static async System.Threading.Tasks.Task AsyncWaitForCompletion(this Tween t)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return; return;
} }
@ -229,7 +241,8 @@ namespace DG.Tweening
/// </summary> /// </summary>
public static async System.Threading.Tasks.Task AsyncWaitForRewind(this Tween t) public static async System.Threading.Tasks.Task AsyncWaitForRewind(this Tween t)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return; return;
} }
@ -243,7 +256,8 @@ namespace DG.Tweening
/// </summary> /// </summary>
public static async System.Threading.Tasks.Task AsyncWaitForKill(this Tween t) public static async System.Threading.Tasks.Task AsyncWaitForKill(this Tween t)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return; return;
} }
@ -258,7 +272,8 @@ namespace DG.Tweening
/// <param name="elapsedLoops">Elapsed loops to wait for</param> /// <param name="elapsedLoops">Elapsed loops to wait for</param>
public static async System.Threading.Tasks.Task AsyncWaitForElapsedLoops(this Tween t, int elapsedLoops) public static async System.Threading.Tasks.Task AsyncWaitForElapsedLoops(this Tween t, int elapsedLoops)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return; return;
} }
@ -274,7 +289,8 @@ namespace DG.Tweening
/// <param name="position">Position (loops included, delays excluded) to wait for</param> /// <param name="position">Position (loops included, delays excluded) to wait for</param>
public static async System.Threading.Tasks.Task AsyncWaitForPosition(this Tween t, float position) public static async System.Threading.Tasks.Task AsyncWaitForPosition(this Tween t, float position)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return; return;
} }
@ -288,7 +304,8 @@ namespace DG.Tweening
/// </summary> /// </summary>
public static async System.Threading.Tasks.Task AsyncWaitForStart(this Tween t) public static async System.Threading.Tasks.Task AsyncWaitForStart(this Tween t)
{ {
if (!t.active) { if (!t.active)
{
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return; return;
} }
@ -312,9 +329,13 @@ namespace DG.Tweening
{ {
public class WaitForCompletion : CustomYieldInstruction public class WaitForCompletion : CustomYieldInstruction
{ {
public override bool keepWaiting { get { public override bool keepWaiting
{
get
{
return t.active && !t.IsComplete(); return t.active && !t.IsComplete();
}} }
}
readonly Tween t; readonly Tween t;
public WaitForCompletion(Tween tween) public WaitForCompletion(Tween tween)
{ {
@ -324,9 +345,13 @@ namespace DG.Tweening
public class WaitForRewind : CustomYieldInstruction public class WaitForRewind : CustomYieldInstruction
{ {
public override bool keepWaiting { get { public override bool keepWaiting
{
get
{
return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0); return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0);
}} }
}
readonly Tween t; readonly Tween t;
public WaitForRewind(Tween tween) public WaitForRewind(Tween tween)
{ {
@ -336,9 +361,13 @@ namespace DG.Tweening
public class WaitForKill : CustomYieldInstruction public class WaitForKill : CustomYieldInstruction
{ {
public override bool keepWaiting { get { public override bool keepWaiting
{
get
{
return t.active; return t.active;
}} }
}
readonly Tween t; readonly Tween t;
public WaitForKill(Tween tween) public WaitForKill(Tween tween)
{ {
@ -348,9 +377,13 @@ namespace DG.Tweening
public class WaitForElapsedLoops : CustomYieldInstruction public class WaitForElapsedLoops : CustomYieldInstruction
{ {
public override bool keepWaiting { get { public override bool keepWaiting
{
get
{
return t.active && t.CompletedLoops() < elapsedLoops; return t.active && t.CompletedLoops() < elapsedLoops;
}} }
}
readonly Tween t; readonly Tween t;
readonly int elapsedLoops; readonly int elapsedLoops;
public WaitForElapsedLoops(Tween tween, int elapsedLoops) public WaitForElapsedLoops(Tween tween, int elapsedLoops)
@ -362,9 +395,13 @@ namespace DG.Tweening
public class WaitForPosition : CustomYieldInstruction public class WaitForPosition : CustomYieldInstruction
{ {
public override bool keepWaiting { get { public override bool keepWaiting
{
get
{
return t.active && t.position * (t.CompletedLoops() + 1) < position; return t.active && t.position * (t.CompletedLoops() + 1) < position;
}} }
}
readonly Tween t; readonly Tween t;
readonly float position; readonly float position;
public WaitForPosition(Tween tween, float position) public WaitForPosition(Tween tween, float position)
@ -376,9 +413,13 @@ namespace DG.Tweening
public class WaitForStart : CustomYieldInstruction public class WaitForStart : CustomYieldInstruction
{ {
public override bool keepWaiting { get { public override bool keepWaiting
{
get
{
return t.active && !t.playedOnce; return t.active && !t.playedOnce;
}} }
}
readonly Tween t; readonly Tween t;
public WaitForStart(Tween tween) public WaitForStart(Tween tween)
{ {

View File

@ -1,12 +1,12 @@
// Author: Daniele Giardini - http://www.demigiant.com // Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/13 // Created: 2018/07/13
using System;
using System.Reflection;
using UnityEngine;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Plugins.Core.PathCore; using DG.Tweening.Plugins.Core.PathCore;
using DG.Tweening.Plugins.Options; using DG.Tweening.Plugins.Options;
using System;
using System.Reflection;
using UnityEngine;
#pragma warning disable 1591 #pragma warning disable 1591
namespace DG.Tweening namespace DG.Tweening
@ -128,13 +128,16 @@ namespace DG.Tweening
#endif #endif
public static TweenerCore<Vector3, Path, PathOptions> CreateDOTweenPathTween( public static TweenerCore<Vector3, Path, PathOptions> CreateDOTweenPathTween(
MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
){ )
{
TweenerCore<Vector3, Path, PathOptions> t = null; TweenerCore<Vector3, Path, PathOptions> t = null;
bool rBodyFoundAndTweened = false; bool rBodyFoundAndTweened = false;
#if true // PHYSICS_MARKER #if true // PHYSICS_MARKER
if (tweenRigidbody) { if (tweenRigidbody)
{
Rigidbody rBody = target.GetComponent<Rigidbody>(); Rigidbody rBody = target.GetComponent<Rigidbody>();
if (rBody != null) { if (rBody != null)
{
rBodyFoundAndTweened = true; rBodyFoundAndTweened = true;
t = isLocal t = isLocal
? rBody.DOLocalPath(path, duration, pathMode) ? rBody.DOLocalPath(path, duration, pathMode)
@ -143,9 +146,11 @@ namespace DG.Tweening
} }
#endif #endif
#if true // PHYSICS2D_MARKER #if true // PHYSICS2D_MARKER
if (!rBodyFoundAndTweened && tweenRigidbody) { if (!rBodyFoundAndTweened && tweenRigidbody)
{
Rigidbody2D rBody2D = target.GetComponent<Rigidbody2D>(); Rigidbody2D rBody2D = target.GetComponent<Rigidbody2D>();
if (rBody2D != null) { if (rBody2D != null)
{
rBodyFoundAndTweened = true; rBodyFoundAndTweened = true;
t = isLocal t = isLocal
? rBody2D.DOLocalPath(path, duration, pathMode) ? rBody2D.DOLocalPath(path, duration, pathMode)
@ -153,7 +158,8 @@ namespace DG.Tweening
} }
} }
#endif #endif
if (!rBodyFoundAndTweened) { if (!rBodyFoundAndTweened)
{
t = isLocal t = isLocal
? target.transform.DOLocalPath(path, duration, pathMode) ? target.transform.DOLocalPath(path, duration, pathMode)
: target.transform.DOPath(path, duration, pathMode); : target.transform.DOPath(path, duration, pathMode);

View File

@ -0,0 +1,104 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Disable
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Alpha
path:
classID: 225
script: {fileID: 0}
flags: 0
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 1574349066
script: {fileID: 0}
typeID: 225
customType: 0
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Alpha
path:
classID: 225
script: {fileID: 0}
flags: 0
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 25f1c28c99920124189b7173731c38b5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -528,6 +528,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5f9054446a969bf4eaf7998f3ba23334, type: 3} m_Script: {fileID: 11500000, guid: 5f9054446a969bf4eaf7998f3ba23334, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
animator: {fileID: 8744505332349586225}
--- !u!1 &2500436782395572584 --- !u!1 &2500436782395572584
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -649,7 +650,7 @@ RectTransform:
m_AnchorMin: {x: 1, y: 0} m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 300, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0.5} m_Pivot: {x: 0, y: 0.5}
--- !u!114 &4478785627166277611 --- !u!114 &4478785627166277611
MonoBehaviour: MonoBehaviour:

View File

@ -1,5 +1,57 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-6499513247890378152
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: active
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -2169522966389634846}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.1
m_TransitionOffset: 0
m_ExitTime: 0.875
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-2169522966389634846
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Disable
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 8949275168816232509}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 25f1c28c99920124189b7173731c38b5, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000 --- !u!91 &9100000
AnimatorController: AnimatorController:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -8,7 +60,19 @@ AnimatorController:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: SelectBorder m_Name: SelectBorder
serializedVersion: 5 serializedVersion: 5
m_AnimatorParameters: [] m_AnimatorParameters:
- m_Name: active
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: reactive
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers: m_AnimatorLayers:
- serializedVersion: 5 - serializedVersion: 5
m_Name: Base Layer m_Name: Base Layer
@ -33,7 +97,10 @@ AnimatorStateMachine:
m_ChildStates: m_ChildStates:
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 5956899137579874003} m_State: {fileID: 5956899137579874003}
m_Position: {x: 340, y: 100, z: 0} m_Position: {x: 380, y: 70, z: 0}
- serializedVersion: 1
m_State: {fileID: -2169522966389634846}
m_Position: {x: 350, y: 200, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []
@ -44,6 +111,31 @@ AnimatorStateMachine:
m_ExitPosition: {x: 800, y: 120, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 5956899137579874003} m_DefaultState: {fileID: 5956899137579874003}
--- !u!1101 &1182501105974621518
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: reactive
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 5956899137579874003}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.875
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &5956899137579874003 --- !u!1102 &5956899137579874003
AnimatorState: AnimatorState:
serializedVersion: 6 serializedVersion: 6
@ -51,10 +143,12 @@ AnimatorState:
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: DEFAULT m_Name: Enable
m_Speed: 1.6 m_Speed: 1.6
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: [] m_Transitions:
- {fileID: -6499513247890378152}
- {fileID: 1182501105974621518}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
@ -70,3 +164,28 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1101 &8949275168816232509
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: active
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 5956899137579874003}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.1
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1

View File

@ -1,7 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client
{ {
public static class EventInvoker public static class EventInvoker

View File

@ -1,6 +1,4 @@
using AxibugEmuOnline.Client; using AxibugEmuOnline.Client;
using AxibugEmuOnline.Client.ClientCore;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.Rendering.PostProcessing; using UnityEngine.Rendering.PostProcessing;

View File

@ -1,7 +1,4 @@
using System.Collections.Generic; namespace AxibugEmuOnline.Client
using UnityEngine;
namespace AxibugEmuOnline.Client
{ {
public abstract class CommandChanger : IKeyMapperChanger public abstract class CommandChanger : IKeyMapperChanger
{ {

View File

@ -3,7 +3,6 @@ using AxibugEmuOnline.Client.Common;
using AxibugEmuOnline.Client.Event; using AxibugEmuOnline.Client.Event;
using AxibugEmuOnline.Client.Network; using AxibugEmuOnline.Client.Network;
using AxibugProtobuf; using AxibugProtobuf;
using System;
namespace AxibugEmuOnline.Client.Manager namespace AxibugEmuOnline.Client.Manager
{ {

View File

@ -1,5 +1,4 @@
using DG.Tweening; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;

View File

@ -5,8 +5,6 @@ using AxibugEmuOnline.Client.Network;
using AxibugProtobuf; using AxibugProtobuf;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine.EventSystems;
using static AxibugEmuOnline.Client.ClientCore.RomDB;
namespace AxibugEmuOnline.Client.Manager namespace AxibugEmuOnline.Client.Manager
{ {

View File

@ -1,6 +1,4 @@
using System; using UnityEngine;
using System.Text;
using UnityEngine;
using VirtualNes.Core; using VirtualNes.Core;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client

View File

@ -1,11 +1,8 @@
using AxibugEmuOnline.Client.Common;
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using VirtualNes.Core; using VirtualNes.Core;
using static UnityEngine.UI.CanvasScaler;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client
{ {

View File

@ -4,7 +4,6 @@ using HaoYueNet.ClientNetworkNet.Standard2;
using System; using System;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
namespace AxibugEmuOnline.Client.Network namespace AxibugEmuOnline.Client.Network
{ {

View File

@ -1,8 +1,6 @@
using DG.Tweening; using DG.Tweening;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Plugins.Options; using DG.Tweening.Plugins.Options;
using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client

View File

@ -1,9 +1,5 @@
using AxibugEmuOnline.Client.ClientCore;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client
{ {

View File

@ -1,6 +1,4 @@
using AxibugEmuOnline.Client.UI; using AxibugEmuOnline.Client.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client

View File

@ -38,7 +38,7 @@ namespace AxibugEmuOnline.Client
m_stepPerformer = new StepPerformer(this); m_stepPerformer = new StepPerformer(this);
//menus.Add(new InGameUI_FilterSetting(this)); menus.Add(new InGameUI_FilterSetting(this));
menus.Add(new InGameUI_Reset(this)); menus.Add(new InGameUI_Reset(this));
menus.Add(new InGameUI_SaveState(this)); menus.Add(new InGameUI_SaveState(this));
menus.Add(new InGameUI_LoadState(this)); menus.Add(new InGameUI_LoadState(this));

View File

@ -1,7 +1,6 @@
using AxibugEmuOnline.Client.ClientCore; using AxibugEmuOnline.Client.ClientCore;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine;
using static AxibugEmuOnline.Client.FilterManager; using static AxibugEmuOnline.Client.FilterManager;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client

View File

@ -1,8 +1,4 @@
using AxibugEmuOnline.Client.ClientCore; using AxibugEmuOnline.Client.ClientCore;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client
{ {

View File

@ -1,8 +1,5 @@
using AxibugEmuOnline.Client.ClientCore; using AxibugEmuOnline.Client.ClientCore;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client
{ {

View File

@ -1,4 +1,3 @@
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;

View File

@ -1,6 +1,4 @@
using System.Collections; using UnityEditor;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.UI; using UnityEditor.UI;
using UnityEngine; using UnityEngine;

View File

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;

View File

@ -1,7 +1,6 @@
using DG.Tweening; using DG.Tweening;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using UnityEngine; using UnityEngine;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client
@ -71,6 +70,7 @@ namespace AxibugEmuOnline.Client
protected override void Update() protected override void Update()
{ {
SelectBorder.Active = Enable;
UpdateMenuState(); UpdateMenuState();
base.Update(); base.Update();
@ -177,6 +177,7 @@ namespace AxibugEmuOnline.Client
var itemUIRect = optionUI_MenuItem.transform as RectTransform; var itemUIRect = optionUI_MenuItem.transform as RectTransform;
SelectBorder.Target = itemUIRect; SelectBorder.Target = itemUIRect;
SelectBorder.RefreshPosition();
if (!m_bPoped) if (!m_bPoped)
{ {

View File

@ -1,6 +1,4 @@
using DG.Tweening; using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
namespace AxibugEmuOnline.Client namespace AxibugEmuOnline.Client

View File

@ -2,7 +2,6 @@ using AxibugEmuOnline.Client.ClientCore;
using AxibugEmuOnline.Client.Event; using AxibugEmuOnline.Client.Event;
using AxibugEmuOnline.Client.UI; using AxibugEmuOnline.Client.UI;
using AxibugProtobuf; using AxibugProtobuf;
using System;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;

View File

@ -1,4 +1,4 @@
using DG.Tweening; using DG.Tweening;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Plugins.Options; using DG.Tweening.Plugins.Options;
using UnityEngine; using UnityEngine;
@ -7,6 +7,8 @@ namespace AxibugEmuOnline.Client
{ {
public class Selector : MonoBehaviour public class Selector : MonoBehaviour
{ {
[SerializeField]
private Animator animator;
private RectTransform m_rect => transform as RectTransform; private RectTransform m_rect => transform as RectTransform;
private RectTransform m_target; private RectTransform m_target;
@ -21,15 +23,13 @@ namespace AxibugEmuOnline.Client
m_target = value; m_target = value;
//重置选择游标的动画
gameObject.SetActive(false);
gameObject.SetActive(true);
var itemUIRect = m_target.transform as RectTransform; var itemUIRect = m_target.transform as RectTransform;
m_rect.pivot = itemUIRect.pivot; m_rect.pivot = itemUIRect.pivot;
m_rect.sizeDelta = itemUIRect.rect.size; m_rect.sizeDelta = itemUIRect.rect.size;
m_rect.SetAsLastSibling(); m_rect.SetAsLastSibling();
animator.SetTrigger("reactive");
if (m_trackTween != null) if (m_trackTween != null)
{ {
m_trackTween.Kill(); m_trackTween.Kill();
@ -40,15 +40,34 @@ namespace AxibugEmuOnline.Client
} }
} }
private void LateUpdate() private bool m_active;
public bool Active
{ {
if (m_trackTween != null) get => m_active;
set
{ {
m_trackTween.endValue = Target.position; if (m_active == value) return;
} m_active = value;
if (Target == null) return;
animator.SetBool("active", value);
}
}
public void RefreshPosition()
{
if (Target != null)
{
m_rect.position = Target.position; m_rect.position = Target.position;
} }
} }
private void LateUpdate()
{
if (m_trackTween != null && m_trackTween.endValue != Target.position)
{
m_trackTween.ChangeEndValue(Target.position, true);
}
if (Target == null) return;
}
}
} }

View File

@ -1,4 +1,3 @@
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;

View File

@ -1,7 +1,6 @@
using AxibugEmuOnline.Client.ClientCore; using AxibugEmuOnline.Client.ClientCore;
using AxibugProtobuf; using AxibugProtobuf;
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;