mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(TopDownShooter): Use FindAnyObjectByType for Unity 2022.2+
This commit is contained in:
parent
d147e8da0e
commit
f5089f14bc
@ -24,7 +24,11 @@ public class EnemyTopDown : NetworkBehaviour
|
|||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
//allow all to run this, they may need it for reference
|
//allow all to run this, they may need it for reference
|
||||||
|
#if UNITY_2022_2_OR_NEWER
|
||||||
|
canvasTopDown = GameObject.FindAnyObjectByType<CanvasTopDown>();
|
||||||
|
#else
|
||||||
canvasTopDown = GameObject.FindObjectOfType<CanvasTopDown>();
|
canvasTopDown = GameObject.FindObjectOfType<CanvasTopDown>();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
|
@ -56,7 +56,11 @@ public override void OnStartLocalPlayer()
|
|||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
// Allow all players to run this, they may need it for reference
|
// Allow all players to run this, they may need it for reference
|
||||||
|
#if UNITY_2022_2_OR_NEWER
|
||||||
|
canvasTopDown = GameObject.FindAnyObjectByType<CanvasTopDown>();
|
||||||
|
#else
|
||||||
canvasTopDown = GameObject.FindObjectOfType<CanvasTopDown>();
|
canvasTopDown = GameObject.FindObjectOfType<CanvasTopDown>();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
|
Loading…
Reference in New Issue
Block a user