Posts

Showing posts with the label delegates

Cannot convert from 'method group' to 'System.Action' error

Image
Clash Royale CLAN TAG #URR8PPP Cannot convert from 'method group' to 'System.Action<object>' error I have created the following function: public void DelegatedCall(Action<Object> delegatedMethod) And defined the following method public void foo1(String str) { } However, when I try to call DelegateCall with foo1 : DelegateCall foo1 DelegatedCall(foo1); ...I get the following compiler error: Argument 1: cannot convert from 'method group' to 'System.Action<object>' Argument 1: cannot convert from 'method group' to 'System.Action<object>' What is the reason for this error and how can I correct it? Unfortunately, casting foo1 to Action is not an option. foo1 Action Related: What is a method group in C#? – DavidRR Jun 10 '16 at 12:57 3 A...

Unity3D - I can't make account creation system

Image
Clash Royale CLAN TAG #URR8PPP Unity3D - I can't make account creation system I'm trying to create an account creation system within Unity, but I run into the following error: error CS0246: The type or namespace name Response could not be found. Are you missing an assembly reference? Script NetworkConnection : public void CreateUser(string userName , string email , string pass , Action<Response> response){ StartCoroutine (Make_CreateUser (userName, email, pass, response)); } private IEnumerator Make_CreateUser(string userName , string email , string pass , Action<Response> response){ WWWForm form = new WWWForm (); form.AddField ("userName", userName); form.AddField ("email", email); form.AddField ("pass", pass); WWW w = new WWW ("http://localhost/game/createUser.php", form); yield return w; response (JsonUtility.FromJson<Response> (w.text)); } [Serializable] public class Respo...