PlayerManager.cs 1.15 KB
//Log Dir         http://docs.unity3d.com/Manual/LogFiles.html
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using System.IO;
using System.Text;
using System.Runtime.InteropServices;
using UnityEngine.UI;

public class PlayerManager : GenericPlayerManager {

	private const string BASE_URL = "http://150.165.205.9/anims/WEBGL/";
	//private const string BASE_URL = "http://150.165.205.9/anims/AssetBundles/0_DefaultBundles/";
	public InputField INFIELD;
	private int version = 1;

	public void catchGlosa(String glosa)
	{
		//Debug.Log ("glosa antes do catch: "+glosa);
		base.glosa = glosa;

		//Debug.Log("glosa depois do catch: "+glosa);
		start_web_play();
	}

	public void start_web_play()
	{
																			
		try {
			base.play();
		} catch(Exception e) {
			e.ToString();//Debug.Log(e+" :: Ops!");
		}
	}

	protected override WWW loadAssetBundle(string aniName)
	{
		return WWW.LoadFromCacheOrDownload(BASE_URL + aniName, version);
	}

	public void start_inputfield_web_play()
	{
		try {
			base.glosa = INFIELD.text;
			base.play();
		}
		catch (Exception e) {
			Debug.Log (e+" :: Exception StartCourr");
		}
	}

}