Beispiel #1
0
    public IEnumerator CreateDroppable(string parent, string marker, string type, string username, string content, string position)
    {
        string url       = "http://" + Droppable.IP + "/travelar/create-drop.php?";
        string paramters = "parent=" + WWW.EscapeURL(parent) + "&marker=" + WWW.EscapeURL(marker) + "&content=" + WWW.EscapeURL(content) + "&type=" + WWW.EscapeURL(type) + "&username="******"&position=" + WWW.EscapeURL(position);
        WWW    www       = new WWW(url + paramters);

        yield return(www);

        // check for errors
        if (www.error == null)
        {
            Debug.Log("Success! " + www.text);
            InteractionHandler[] ihscripts = GameObject.FindObjectsOfType <InteractionHandler> ();
            foreach (InteractionHandler hs in ihscripts)
            {
                if (hs.enabled && hs.gameObject.name.Equals(parent))
                {
                    StartCoroutine(DroppableFetcher.FetchSpecificDroppables(hs, parent, true));
                }
            }


            ShowCreator();
        }
        else
        {
            Debug.Log("WWW Error: " + www.error);
        }
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     droppables   = new List <String> ();
     textbox      = GameObject.FindGameObjectWithTag("Label");
     droppedBy    = GetComponentInChildren <TextMesh> ();
     textboxImage = textbox.GetComponent <UnityEngine.UI.Image> ();
     StartCoroutine(DroppableFetcher.FetchSpecificDroppables(this, gameObject.name, interactType.Equals(InteractableType.MAIN)));
     label  = textbox.GetComponentInChildren <UnityEngine.UI.Text> ();
     player = FindObjectOfType <AudioSource> ();
 }