blob: 4e202020b826e8bef9b12c307ae5e00f21c84e04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//https://zhuanlan.zhihu.com/p/150812545
//https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Scripting/Abilities_Data_Driven/zh
namespace WK
{
/// <summary>
/// Buff生命周期
/// 实例化 -> 加入列表前 -> 加入列表后 -> 更新 -> 移出列表前 -> 移出列表后
/// 每一步都会向当前对象作用域内广播消息
/// </summary>
public abstract class BuffBehaviour
{
/// <summary>
/// buff实例化时
/// </summary>
public virtual void OnCreate()
{
}
/// <summary>
/// 获得这个buff(加入列表前)
/// </summary>
public virtual void OnBeforeAttach()
{
}
/// <summary>
/// 加入列表后,激活这个buff
/// </summary>
public virtual void OnAfterAttach()
{
}
/// <summary>
/// 第一次Update前
/// </summary>
public virtual void OnStart()
{
}
/// <summary>
/// 从列表移出前
/// </summary>
public virtual void OnBeforeDeattach()
{
}
/// <summary>
/// 移除这个buff(移出列表后)
/// </summary>
public virtual void OnAfterDeattach()
{
}
/// <summary>
/// 每帧逻辑更新(如果需要的话)
/// </summary>
public virtual void OnUpdate()
{
}
}
}
|