Hi. In theory I think is about right but for some reason it doesn't work. Any ideas? Thank you very much for your help!
public delegate void PullFunction(GameObject o);
[18-1-19] Compile file : 1212.cs
public delegate void PullFunction(GameObject o);
if (Object.S1NPCDataController.Name == "name1") return false;
if (Object.S1NPCDataController.Name == "name2") return false;
if (Object.S1NPCDataController.Name == "name3") return false;
[18-1-19] Compile file : 1212.cs
[18-1-19] [COMPILER] Compilation error !
[18-1-19] Line number : 310, Error Number : CS1519, 'Symbol 'if' not valid
[18-1-19] Line number : 310, Error Number : CS1519, 'Symbol '==' not valid
[18-1-19] Line number : 311, Error Number : CS1519,'Symbol '==' not valid
[18-1-19] Line number : 312, Error Number : CS1519, 'Symbol '==' not valid
VulpesPosted May 12, 2013, 2:15 PM
Assuming that Name is a read-only string property, you're not setting it but getting it to see whether it's equal to some 'literal' value.
Jesus VicentePosted May 12, 2013, 1:40 PM
VulpesPosted May 12, 2013, 12:35 PM
1. The compiler thinks that Object refers to System.Object (or 'object' in C#) which doesn't have a property called S1NPCDataController.
2. The three 'if' statements do not appear within a method or property but at class level or even outside any class which, of course, is not allowed in C#.