using UnityEngine;
using VRStandardAssets.Utils;//引用此脚本
using UnityEngine.UI;//使用image类型添加脚本
public class VRManger : MonoBehaviour
{
private Image ring;
VRInteractiveItem vrItem;
private void Awake()
{
vrItem = GetComponent<VRInteractiveItem>() ??
gameObject.AddComponent<VRInteractiveItem>();//先判断是否有组件如果没有则加上,有就不加,并且加上后赋值给veitem
ring = GameObject.FindGameObjectsWithTag("ring")
.GetComponent<Image>();//查找ring,获得image组件
}
提示:Assets\Scripts\VRManger.cs(16,14): error CS1061: 'GameObject[]' does not contain a definition for 'GetComponent' and no accessible extension method 'GetComponent' accepting a first argument of type 'GameObject[]' could be found (are you missing a using directive or an assembly reference?)怎么办