Skip to content

Commit c2554a5

Browse files
committed
Marking some methods virtual and only calling InitRenderer multiple times when in Editor mode for Editor Functions
1 parent 25dfcd8 commit c2554a5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

CreaturePack/Distro/CreaturePackRenderer.cs

+7-4
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private bool reloadSkinSwap()
196196
}
197197

198198
// Use this for initialization
199-
void Start () {
199+
protected virtual void Start () {
200200
Awake();
201201
}
202202

@@ -222,14 +222,17 @@ public void InitRenderer()
222222
}
223223
}
224224

225-
public void Awake()
225+
public virtual void Awake()
226226
{
227227
InitRenderer();
228228
}
229229

230-
public void OnEnable()
230+
public virtual void OnEnable()
231231
{
232-
InitRenderer();
232+
if (!Application.isPlaying)
233+
{
234+
InitRenderer();
235+
}
233236
}
234237

235238
public void CreateRenderingData()

0 commit comments

Comments
 (0)