{
public List<Text> Buttons;
public List<string> Services;
public List<string> Characteristics;
// Use this for initialization
void Start ()
{
int buttonID = 0;
foreach (var device in FoundDeviceListScript.DeviceAddressList) // bu kısım için hata veriyor . 15. satır...
{
Buttons[buttonID++].text = device.Name;
if (buttonID == 4)
break;
}
}
...
-FoundDeviceListScript-
public class FoundDeviceListScript : MonoBehaviour
{
static public List<DeviceObject> DeviceAddressList;
// Use this for initialization
void Start ()
{
DontDestroyOnLoad (gameObject);
}
}
-DeviceObjectScript-
public class DeviceObject
{
public string Address;
public string Name;
public DeviceObject ()
{
Address = "";
Name = "";
}
public DeviceObject (string address, string name)
{
Address = address;
Name = name;
}
}
public class Level2Script : MonoBehaviour
{
public List<Text> Buttons;
public List<string> Services;
public List<string> Characteristics;
// Use this for initialization
void Start ()
{
int buttonID = 0;
foreach (var device in FoundDeviceListScript.DeviceAddressList) // bu kısım için hata veriyor . 15. satır...
{
Buttons[buttonID++].text = device.Name;
if (buttonID == 4)
break;
}
}
...
-FoundDeviceListScript-
public class FoundDeviceListScript : MonoBehaviour
{
static public List<DeviceObject> DeviceAddressList;
// Use this for initialization
void Start ()
{
DontDestroyOnLoad (gameObject);
}
}
-DeviceObjectScript-
public class DeviceObject
{
public string Address;
public string Name;
public DeviceObject ()
{
Address = "";
Name = "";
}
public DeviceObject (string address, string name)
{
Address = address;
Name = name;
}
}
FoundDeviceListScript nesneniz null. Bu sebepten hata alıyorsunuz.
","url":"https://uzmanim.net/soru/nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object-level2script-start-at-level2script-cs-15/68580#a68582","author":{"@type":"Person","name":"murat"},"comment":[],"commentCount":0,"dateCreated":"2016-07-13T15:59:54.937+03:00","dateModified":"2016-07-13T15:59:54.937+03:00","text":"FoundDeviceListScript nesneniz null. Bu sebepten hata alıyorsunuz.
","upvoteCount":0},"answerCount":1,"suggestedAnswer":{"@type":"Answer","name":"FoundDeviceListScript nesneniz null. Bu sebepten hata alıyorsunuz.
","url":"https://uzmanim.net/soru/nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object-level2script-start-at-level2script-cs-15/68580#a68582","author":{"@type":"Person","name":"murat"},"comment":[],"commentCount":0,"dateCreated":"2016-07-13T15:59:54.937+03:00","dateModified":"2016-07-13T15:59:54.937+03:00","text":"FoundDeviceListScript nesneniz null. Bu sebepten hata alıyorsunuz.
","upvoteCount":0},"upvoteCount":0}}public class Level2Script : MonoBehaviour
{
public List<Text> Buttons;
public List<string> Services;
public List<string> Characteristics;
// Use this for initialization
void Start ()
{
int buttonID = 0;
foreach (var device in FoundDeviceListScript.DeviceAddressList) // bu kısım için hata veriyor . 15. satır...
{
Buttons[buttonID++].text = device.Name;
if (buttonID == 4)
break;
}
}
...
-FoundDeviceListScript-
public class FoundDeviceListScript : MonoBehaviour
{
static public List<DeviceObject> DeviceAddressList;
// Use this for initialization
void Start ()
{
DontDestroyOnLoad (gameObject);
}
}
-DeviceObjectScript-
public class DeviceObject
{
public string Address;
public string Name;
public DeviceObject ()
{
Address = "";
Name = "";
}
public DeviceObject (string address, string name)
{
Address = address;
Name = name;
}
}
Toplam 1 cevap
FoundDeviceListScript nesneniz null. Bu sebepten hata alıyorsunuz.