Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. public class LevelManager : MonoBehaviour
  2. {
  3.     public GameObject player1;
  4.     public GameObject player2;
  5.     public Inventory myInventory;
  6.    
  7.  
  8.  
  9.     void Start()
  10.     {
  11.         DontDestroyOnLoad(gameObject);
  12.         myInventory = GameObject.FindObjectOfType<Inventory> ();
  13.  
  14.         if(myInventory.GetPlayer2() == true)
  15.         {
  16.               Instantiate(player2, player2.transform.position, Quaternion.identity);
  17.         }
  18.         else
  19.         {
  20.          
  21.             Instantiate(player1, player1.transform.position, Quaternion.identity);
  22.         }
  23.  
  24.     }
  25.  
  26.  
  27.  
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement