// 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); } } } } } }
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); }
// Use this for initialization void Start() { inv = gameObject.GetComponent<playerInventory>(); respawns = GameObject.FindGameObjectWithTag("GameManager").GetComponent<RespawnAndDeaths>(); net = GameObject.FindGameObjectWithTag("GameManager").GetComponent<NetworkManager>(); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); PlayerInventory = player.GetComponent <playerInventory>(); testo_pre_infermeria.SetActive(false); }
void Awake() { table = orderTable.instance; inventory = GameObject.Find("player").GetComponent <playerInventory>(); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); playerInventory = player.GetComponent <playerInventory>(); testo_collider.SetActive(false); }
void Start () { playerInvScript = player.GetComponent<playerInventory> (); }