void OnTriggerEnter(Collider other) { // Player인지 판정. if (other.tag == "Player") { // 아이템 획득. CharacterStatus aStatus = other.GetComponent <CharacterStatus>(); aStatus.GetItem(kind); // 오디오 재생. AudioSource.PlayClipAtPoint(itemSeClip, transform.position); // 아이템 획득을 소유자에게 알린다. PlayerCtrl playerCtrl = other.GetComponent <PlayerCtrl>(); if (playerCtrl.networkView.isMine) { if (networkView.isMine) { GetItemOnNetwork(playerCtrl.networkView.viewID); } else { networkView.RPC("GetItemOnNetwork", networkView.owner, playerCtrl.networkView.viewID); } } } }
void OnTriggerEnter(Collider other) { if (other.tag == "Player") { CharacterStatus aStatus = other.GetComponent <CharacterStatus>(); aStatus.GetItem(kind); Destroy(gameObject); // Play Audio. AudioSource.PlayClipAtPoint(this.itemSeClip, transform.position); } }
void OnTriggerEnter(Collider other) { // Player인지 판정. if (other.tag == "Player") { // 아이템 획득. CharacterStatus aStatus = other.GetComponent <CharacterStatus>(); aStatus.GetItem(kind); // 획득했으면 아이템을 삭제. Destroy(gameObject); } }
void OnTriggerEnter(Collider other) { // Playerか判定 if (other.tag == "Player") { // アイテム取得 CharacterStatus aStatus = other.GetComponent <CharacterStatus>(); aStatus.GetItem(kind); // 取得したらアイテムを消す Destroy(gameObject); } }
void OnTriggerEnter(Collider other) { PlayerCtrl playerCtrl = other.GetComponent <PlayerCtrl>(); if (playerCtrl == null) { return; } CharacterStatus aStatus = other.GetComponent <CharacterStatus>(); aStatus.GetItem(kind); Destroy(gameObject); }
void OnTriggerEnter(Collider other) { // Playerか判定 if (other.tag == "Player") { // アイテム取得 CharacterStatus aStatus = other.GetComponent <CharacterStatus>(); aStatus.GetItem(kind); // 取得したらアイテムを消す Destroy(gameObject); //オーディオ AudioSource.PlayClipAtPoint(itemSeClip, transform.position); } }
void OnTriggerEnter(Collider other) { // Player인지 판정. if (other.tag == "Player") { // 아이템 획득. CharacterStatus aStatus = other.GetComponent <CharacterStatus>(); aStatus.GetItem(kind); // 획득했으면 아이템을 삭제. Destroy(gameObject); // 오디오 재생. AudioSource.PlayClipAtPoint(itemSeClip, transform.position); } }
void OnTriggerEnter(Collider other) { // Playerか判定. if( other.tag == "Player" ){ // アイテム取得. CharacterStatus aStatus = other.GetComponent<CharacterStatus>(); aStatus.GetItem(kind); // オーディオ再生. AudioSource.PlayClipAtPoint(itemSeClip,transform.position); // アイテムを取得をオーナーへ通知する. PlayerCtrl playerCtrl = other.GetComponent<PlayerCtrl>(); if (playerCtrl.GetComponent<NetworkView>().isMine) { if (GetComponent<NetworkView>().isMine) GetItemOnNetwork(playerCtrl.GetComponent<NetworkView>().viewID); else GetComponent<NetworkView>().RPC("GetItemOnNetwork",GetComponent<NetworkView>().owner,playerCtrl.GetComponent<NetworkView>().viewID); } } }