33 lines
692 B
C#
33 lines
692 B
C#
![]() |
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class GoldOre : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField] public GameObject dropedItem;
|
||
|
|
||
|
// Start is called before the first frame update
|
||
|
void Start()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
public void DropItem()
|
||
|
{
|
||
|
GameObject globalGUI = GameObject.FindGameObjectsWithTag("GUI")[0];
|
||
|
|
||
|
if(globalGUI)
|
||
|
{
|
||
|
Instantiate(dropedItem, gameObject.transform.position, Quaternion.identity, globalGUI.transform);
|
||
|
} else {
|
||
|
Debug.Log("Can't find global GUI object!!!");
|
||
|
}
|
||
|
}
|
||
|
}
|