"Assets/Loop.cs(45,63): error CS1061: Type `object' does not contain a definition for `pName' and no extension method `pName' of type `object' could be found (are you missing a using directive or an assembly reference?)"
Вот что я делаю.
Синтаксис:
Используется csharp
public class Loop : MonoBehaviour {
public ArrayList pListInterfaces = new ArrayList();
public Dictionary<string, int> pListInterfacesIds = new Dictionary<string, int>();
public InterfaceSplash pInterfaceSplash = new InterfaceSplash();
void Start () {
pListInterfaces.Add(pInterfaceSplash);
pListInterfacesIds.Add(pInterfaceSplash.pName, pListInterfaces.Count-1);
string lNameTmp = "InterfaceSplash";
int lId = pListInterfacesIds[lNameTmp];
object lObject = pListInterfaces[lId];
print(lObject.pName);//Здесь выходит ошибка.......ПАЧЕМУУУ???
}
}
--------------------------------------------------------------------------------------------
using System;
using UnityEngine;
public class InterfaceSplash{
public string pName = "InterfaceSplash";
}
public ArrayList pListInterfaces = new ArrayList();
public Dictionary<string, int> pListInterfacesIds = new Dictionary<string, int>();
public InterfaceSplash pInterfaceSplash = new InterfaceSplash();
void Start () {
pListInterfaces.Add(pInterfaceSplash);
pListInterfacesIds.Add(pInterfaceSplash.pName, pListInterfaces.Count-1);
string lNameTmp = "InterfaceSplash";
int lId = pListInterfacesIds[lNameTmp];
object lObject = pListInterfaces[lId];
print(lObject.pName);//Здесь выходит ошибка.......ПАЧЕМУУУ???
}
}
--------------------------------------------------------------------------------------------
using System;
using UnityEngine;
public class InterfaceSplash{
public string pName = "InterfaceSplash";
}