Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 统一性问题,无法在全息透镜上显示统一性的原始图像_C#_Unity3d_Hololens - Fatal编程技术网

C# 统一性问题,无法在全息透镜上显示统一性的原始图像

C# 统一性问题,无法在全息透镜上显示统一性的原始图像,c#,unity3d,hololens,C#,Unity3d,Hololens,最近我在做一个项目,我试图用声音命令在全息镜头上滚动图像。在unity文件夹中,我创建了一个名为dell的原始映像。然而,使用语音命令,我希望将原始图像更改为名为acer的图像。我在visualstudios中运行了一个调试器,这就是它给我带来的错误 NullReferenceException: Object reference not set to an instance of an object. at SpriteManager.NextImage() at SpriteMa

最近我在做一个项目,我试图用声音命令在全息镜头上滚动图像。在unity文件夹中,我创建了一个名为dell的原始映像。然而,使用语音命令,我希望将原始图像更改为名为acer的图像。我在visualstudios中运行了一个调试器,这就是它给我带来的错误

NullReferenceException: Object reference not set to an instance of an object.
   at SpriteManager.NextImage()
   at SpriteManager.$Invoke0(Int64 instance, Int64* args)
   at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method) 
我不知道为什么会出现这个错误

这是我的代码:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class SpriteManager : MonoBehaviour {

    public GameObject a;
    public Sprite dell;

    //int count = 0;

    void Start () {

    }  
   void NextImage()
    {
        Debug.Log("It's working!");
        GetComponent<RawImage>().texture = a.GetComponent<RawImage>().texture;

    }

    // Update is called once per frame
    void Update () {

    }
}
使用系统;
使用系统集合;
使用System.Collections.Generic;
使用UnityEngine;
使用UnityEngine.UI;
公共类精神管理器:单一行为{
公共游戏对象a;
公共雪碧戴尔;
//整数计数=0;
无效开始(){
}  
void NextImage()
{
Log(“它正在工作!”);
GetComponent().texture=a.GetComponent().texture;
}
//每帧调用一次更新
无效更新(){
}
}
在debug.log()之后,我收到一个错误

戴尔在我的unity项目中是一个2d精灵,我也想改变我的形象

有人能帮忙吗