Skip to content

Commit abd85e3

Browse files
committed
改变Data路径,允许挪动整个文件夹;解决层级变化异常的Bug;
1 parent f69a517 commit abd85e3

File tree

160 files changed

+2094
-190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+2094
-190
lines changed

Assets/NoSLoofah_BuffSystem.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/BuffSystem.meta renamed to Assets/NoSLoofah_BuffSystem/BuffSystem.meta

File renamed without changes.

Assets/BuffSystem/Base.meta renamed to Assets/NoSLoofah_BuffSystem/BuffSystem/Base.meta

File renamed without changes.

Assets/BuffSystem/Base/BuffBase.meta renamed to Assets/NoSLoofah_BuffSystem/BuffSystem/Base/BuffBase.meta

File renamed without changes.

Assets/BuffSystem/Base/BuffBase/Buff.cs renamed to Assets/NoSLoofah_BuffSystem/BuffSystem/Base/BuffBase/Buff.cs

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public Buff Clone()
5656
[SerializeField][HideInInspector] private int id;
5757
private int tmpLayer = 0;
5858
private bool layerModified = false;
59+
private bool firstFrame;
5960
public bool RemoveOneLayerOnTimeUp => removeOneLayerOnTimeUp;
6061
public BuffMutilAddType MutilAddType => mutilAddType;
6162
public BuffTag BuffTag => buffTag;
@@ -67,11 +68,23 @@ public virtual void OnBuffAwake()
6768
{
6869
timer = duration;
6970
isEffective = true;
70-
Layer = 1;
71-
71+
Layer = 0;
72+
ModifyLayer(1);
73+
firstFrame = true;
74+
Debug.Log(Layer);
7275
}
73-
public abstract void OnBuffDestroy();
7476
public abstract void OnBuffRemove();
77+
78+
public virtual void OnBuffDestroy()
79+
{
80+
if (mutilAddType == BuffMutilAddType.multipleLayer || mutilAddType == BuffMutilAddType.multipleLayerAndResetTime)
81+
{
82+
ModifyLayer(-Layer);
83+
isEffective = false;
84+
}
85+
RealModifyLayer();
86+
}
87+
7588
public abstract void OnBuffStart();
7689
public abstract void OnBuffModifyLayer(int change);
7790
public abstract void Reset();
@@ -118,6 +131,11 @@ public void StopBuffTickEffect()
118131
}
119132
public void OnBuffUpdate()
120133
{
134+
if (firstFrame)
135+
{
136+
firstFrame = false;
137+
return;
138+
}
121139
if (!IsEffective) return;
122140
if (!isPermanent) timer -= Time.deltaTime;
123141
if (!isPermanent && timer <= 0)
@@ -127,11 +145,6 @@ public void OnBuffUpdate()
127145
timer = duration;
128146
ModifyLayer(-1);
129147
}
130-
else if (mutilAddType == BuffMutilAddType.multipleLayer || mutilAddType == BuffMutilAddType.multipleLayerAndResetTime)
131-
{
132-
ModifyLayer(-Layer);
133-
isEffective = false;
134-
}
135148
}
136149
RealModifyLayer();
137150
if (!runTickTimer) return;
@@ -159,7 +172,7 @@ private void RealModifyLayer()
159172
}
160173
public void ModifyLayer(int i)
161174
{
162-
if (mutilAddType != BuffMutilAddType.multipleLayer && mutilAddType != BuffMutilAddType.multipleLayerAndResetTime)
175+
if (Layer + i != 0 && Layer + i != 1 && mutilAddType != BuffMutilAddType.multipleLayer && mutilAddType != BuffMutilAddType.multipleLayerAndResetTime)
163176
throw new System.Exception("试图修改非层级Buff的层数");
164177
tmpLayer += i;
165178
layerModified = true;

Assets/BuffSystem/Base/BuffBase/Buff.cs.meta renamed to Assets/NoSLoofah_BuffSystem/BuffSystem/Base/BuffBase/Buff.cs.meta

File renamed without changes.

Assets/BuffSystem/Base/BuffBase/IBuff.cs renamed to Assets/NoSLoofah_BuffSystem/BuffSystem/Base/BuffBase/IBuff.cs

File renamed without changes.

Assets/BuffSystem/Base/BuffBase/IBuff.cs.meta renamed to Assets/NoSLoofah_BuffSystem/BuffSystem/Base/BuffBase/IBuff.cs.meta

File renamed without changes.

Assets/BuffSystem/Base/BuffBase/PlaceholderBuff.cs renamed to Assets/NoSLoofah_BuffSystem/BuffSystem/Base/BuffBase/PlaceholderBuff.cs

File renamed without changes.

Assets/BuffSystem/Base/BuffBase/PlaceholderBuff.cs.meta renamed to Assets/NoSLoofah_BuffSystem/BuffSystem/Base/BuffBase/PlaceholderBuff.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)