GetItem() public method

public GetItem ( DropItem, itemKind ) : void
itemKind DropItem,
return void
示例#1
0
 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);
             }
         }
     }
 }
示例#2
0
    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);
        }
    }
示例#3
0
 void OnTriggerEnter(Collider other)
 {
     // Player인지 판정.
     if (other.tag == "Player")
     {
         // 아이템 획득.
         CharacterStatus aStatus = other.GetComponent <CharacterStatus>();
         aStatus.GetItem(kind);
         // 획득했으면 아이템을 삭제.
         Destroy(gameObject);
     }
 }
示例#4
0
 void OnTriggerEnter(Collider other)
 {
     // Playerか判定
     if (other.tag == "Player")
     {
         // アイテム取得
         CharacterStatus aStatus = other.GetComponent <CharacterStatus>();
         aStatus.GetItem(kind);
         // 取得したらアイテムを消す
         Destroy(gameObject);
     }
 }
示例#5
0
    void OnTriggerEnter(Collider other)
    {
        PlayerCtrl playerCtrl = other.GetComponent <PlayerCtrl>();

        if (playerCtrl == null)
        {
            return;
        }
        CharacterStatus aStatus = other.GetComponent <CharacterStatus>();

        aStatus.GetItem(kind);
        Destroy(gameObject);
    }
示例#6
0
    void OnTriggerEnter(Collider other)
    {
        // Playerか判定
        if (other.tag == "Player")
        {
            // アイテム取得
            CharacterStatus aStatus = other.GetComponent <CharacterStatus>();
            aStatus.GetItem(kind);
            // 取得したらアイテムを消す
            Destroy(gameObject);

            //オーディオ
            AudioSource.PlayClipAtPoint(itemSeClip, transform.position);
        }
    }
示例#7
0
    void OnTriggerEnter(Collider other)
    {
        // Player인지 판정.
        if (other.tag == "Player")
        {
            // 아이템 획득.
            CharacterStatus aStatus = other.GetComponent <CharacterStatus>();
            aStatus.GetItem(kind);
            // 획득했으면 아이템을 삭제.
            Destroy(gameObject);

            // 오디오 재생.
            AudioSource.PlayClipAtPoint(itemSeClip, transform.position);
        }
    }
示例#8
0
	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);
			}
		}
	}