// In first OnEnable isLocalPlayer is not set yet.
 private void Start()
 {
     if (!isLocalPlayer)
     {
         return;
     }
     cameraFollow = Camera.main.GetComponent <Camera2DFollowMany>();
     cameraFollow.AddPlayer(gameObject);
 }
Ejemplo n.º 2
0
 void OnEnable()
 {
     cameraFollow = Camera.main.GetComponent <Camera2DFollowMany>();
     cameraFollow.AddPlayer(this.gameObject);
 }