-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMyMonoBehaviour.cs
More file actions
44 lines (38 loc) · 1.01 KB
/
MyMonoBehaviour.cs
File metadata and controls
44 lines (38 loc) · 1.01 KB
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
// Copyright (c) 2021-2025 Koji Hasegawa.
// This software is released under the MIT License.
using System.Diagnostics.CodeAnalysis;
using UnityEngine;
namespace APIExamples
{
/// <summary>
/// <see cref="APIExamples.UnityTestFramework.MonoBehaviourTestExample"/> のテスト対象.
/// 生成されて5フレームで破棄されます
/// </summary>
[SuppressMessage("ReSharper", "InvalidXmlDocComment")]
public class MyMonoBehaviour : MonoBehaviour
{
protected bool _wasAwake;
protected bool _wasStart;
protected bool _wasDestroy;
private int _frameCount;
private void Awake()
{
_wasAwake = true;
}
private void Start()
{
_wasStart = true;
}
private void Update()
{
if (++_frameCount > 4)
{
Destroy(this.gameObject);
}
}
private void OnDestroy()
{
_wasDestroy = true;
}
}
}