Пример #1
0
 public void registerCamera(CameraEdgeController cam)
 {
     cornerMap.Add(cam.screenCorner, cam);
     if (cornerMap.Count >= 4)
     {
         ScanForMainPlayer();
         GeneratePlayerClones();
     }
 }
Пример #2
0
 public void TriggerDespawnEvent(CameraEdgeController alerted, EdgeCheck edge)
 {
     if (UseWarp)
     {
         if (true && !alerted.containsPoint(alerted.attachedPlayer.transform.position)) //TODO: If no other camera edge controls this player
         {
             CameraPlayerMap[alerted].gameObject.SetActive(false);
         }
     }
 }
Пример #3
0
 public void TriggerSpawnEvent(CameraEdgeController alerted, EdgeCheck edge)  //Gets called when this camera's edge collider detects the player
 {
     if (UseWarp)
     {
         WarpTo destination = alerted.getWarp(edge.dir);
         if (!CameraPlayerMap[destination.cam].gameObject.activeInHierarchy) //If no other camera is currently using this player
         {
             PlayerMovement Clone  = CameraPlayerMap[destination.cam];
             PlayerMovement Source = CameraPlayerMap[alerted];
             Vector3        offset = edge.transform.position - Source.transform.position;
             Clone.transform.position = destination.edge.transform.position - offset;
             Clone.gameObject.SetActive(true);
             Clone.GetComponent <Rigidbody2D>().velocity = Source.GetComponent <Rigidbody2D>().velocity;
             //TODO: Keep player variables consistent
             //Clone.CopyState(Source);
         }
     }
 }
Пример #4
0
 void Start()
 {
     cameraParent = GetComponentInParent <CameraEdgeController>();
 }
Пример #5
0
 public WarpTo(CameraEdgeController newCam, EdgeCheck newEdge)
 {
     cam  = newCam;
     edge = newEdge;
 }