- Home /
Question by
Pettteri.p · Dec 05, 2015 at 06:10 PM ·
getcomponentstringattributemetadata
Getting value from another script
Hey!
I've been trying to get mTargetMetadata value from my other script. So far I've been able to bring it only if I define it myself. That's all good but I'm trying to get the value after it gets new value from cloud. I've tried lots of differend methods getting it, but so far it bring null value.
So, this is where I'm trying to get it from
public static string mTargetMetadata = "";
.
.
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) {
// do something with the target metadata
mTargetMetadata = targetSearchResult.MetaData;
And this is the latest how I've tried to get it
string mTargetMetadata = CloudRecoEventHandler.OnNewSearchResult(TargetFinder.TargetSearchResult);
Is this the right way to try and get it? This is still getting me error cs0236 field initializer cannot reference a nonestatic field, method or property, but am I in the right track?
How should I get that value?:S
Comment