Skip to content

Commit eebdad0

Browse files
committed
feat: add DevelopmentBuildDependant._onlyOnBuilds field
1 parent 6c8d736 commit eebdad0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Runtime/Behaviours/DevelopmentBuildDependant.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ namespace Utils.Behaviours
55
public class DevelopmentBuildDependant : MonoBehaviour
66
{
77
[SerializeField] private bool existsIfDevBuild;
8+
[SerializeField] private bool _onlyOnBuilds;
89

910
private void Awake()
1011
{
11-
if (Debug.isDebugBuild != existsIfDevBuild)
12+
var shouldDestroy = Debug.isDebugBuild != existsIfDevBuild;
13+
shouldDestroy |= _onlyOnBuilds && Application.isEditor;
14+
if (shouldDestroy)
1215
{
1316
Destroy(gameObject);
1417
}

0 commit comments

Comments
 (0)