Пример #1
0
 // Update is called once per frame
 void OnTriggerEnter(Collider other)
 {
     if(other.transform.tag == "Player"){
         inv = other.gameObject.GetComponent<playerInventory>();
         GameObject weaponParent = other.gameObject.transform.GetChild (0).GetChild (0).gameObject;
         if(inv.firstWeapon == null){
             SetFirstWeapon(weaponParent);
         }
         else{
             if(inv.firstWeapon != null && inv.secondWeapon == null){
                 SetSecondWeapon(weaponParent);
             }
             else{
                 if(inv.firstWeapon != null && inv.secondWeapon != null){
                     if(inv.firstWeaponOut){
                         SetFirstWeapon(weaponParent);
                     }
                     else{
                         SetSecondWeapon(weaponParent);
                     }
                 }
             }
         }
     }
 }
Пример #2
0
	void OnTriggerEnter2D(Collider2D other)
	{
		player = other.gameObject;
		playerInvScript = player.GetComponent<playerInventory> ();
		playerInvScript.drawer = this.gameObject;
		playerInvScript.playerNearDrawer = true;
		playerInvScript.objectInTheThingie = objectInThisThingie;
		pressEText = "Press E to search "+this.gameObject.name+".";
		textObj.GetComponent<textBox>().TextUpdate(pressEText);
	}
Пример #3
0
 // Use this for initialization
 void Start()
 {
     inv = gameObject.GetComponent<playerInventory>();
      	respawns = GameObject.FindGameObjectWithTag("GameManager").GetComponent<RespawnAndDeaths>();
     net = GameObject.FindGameObjectWithTag("GameManager").GetComponent<NetworkManager>();
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     player          = GameObject.FindGameObjectWithTag("Player");
     PlayerInventory = player.GetComponent <playerInventory>();
     testo_pre_infermeria.SetActive(false);
 }
Пример #5
0
 void Awake()
 {
     table     = orderTable.instance;
     inventory = GameObject.Find("player").GetComponent <playerInventory>();
 }
Пример #6
0
 // Use this for initialization
 void Start()
 {
     player          = GameObject.FindGameObjectWithTag("Player");
     playerInventory = player.GetComponent <playerInventory>();
     testo_collider.SetActive(false);
 }
Пример #7
0
	void Start () 
	{
		playerInvScript = player.GetComponent<playerInventory> ();
	}