Ejemplo n.º 1
0
 /// <summary>
 /// 回调返回的数据都需要进行null判断
 /// </summary>
 public void AddListener(CallBackWithParams <T> _callback)
 {
     if (_callback != null)
     {
         mCallback += _callback;
     }
 }
Ejemplo n.º 2
0
	void OnBillingFinish (string result)
	{
		Debug.Log ("OnBillingFinish:" + result);
		if (onCallBack != null)
			onCallBack (result);
		onCallBack = null;
	}
Ejemplo n.º 3
0
    public void CreatPrefab(Object obj, CallBackWithParams <GameObject, Dictionary <string, object> > callback = null, Dictionary <string, object> parameters = null)
    {
        GameObject go = null;

        if (obj != null)
        {
            go = GameObject.Instantiate(obj) as GameObject;
        }
        else
        {
            go = new GameObject();
        }

        if (callback != null)
        {
            callback(go, parameters);
        }

        string fold = PathHelper.GetFoldByFullName(path);

        if (!Directory.Exists(fold))
        {
            Directory.CreateDirectory(fold);
        }

        if (File.Exists(path))
        {
            File.Delete(path);
        }

        PrefabUtility.CreatePrefab(path, go);
        GameObject.DestroyImmediate(go);
        AssetDatabase.Refresh();
    }
Ejemplo n.º 4
0
 public void RemoveListener(CallBackWithParams <ResponseData> _callback)
 {
     if (_callback != null)
     {
         callback -= _callback;
     }
 }
Ejemplo n.º 5
0
 public void AddListenerIdle(CallBackWithParams <LoaderItem> callback)
 {
     if (callback != null)
     {
         idleCallback += callback;
     }
 }
Ejemplo n.º 6
0
 public void AddListener(CallBackWithParams <ResponseData> _callback)
 {
     if (_callback != null)
     {
         callback += _callback;
     }
 }
Ejemplo n.º 7
0
 public void AddListenerOff(CallBackWithParams <CharacterClothItem> callback)
 {
     if (callback != null)
     {
         OffFinishCallback += callback;
     }
 }
Ejemplo n.º 8
0
 public void RemoveListener(CallBackWithParams <T> _callback)
 {
     if (_callback != null)
     {
         mCallback -= _callback;
     }
 }
Ejemplo n.º 9
0
	/// <summary>
	/// 发起支付
	/// </summary>
	/// <param name="paycode">Paycode.</param>
	/// <param name="paynum">Paynum.</param>
	/// <param name="ckFun">Ck fun.</param>
	public void Order (string paycode, int paynum, CallBackWithParams<string> ckFun)
	{
		onCallBack = ckFun;
		if (!IsInit)
			return;
		MM_IAPBinding.SetListener (name, "OnBillingFinish");
		MM_IAPBinding.Order (paycode, paynum);
	}
    protected override void webLoadRes(object[] objs)
    {
        callback = objs[0] as CallBackWithParams <Object>;

        request = new SOAService_Resource_Character_Bundle_Config();
        request.AddListener(LoadComplete);
        request.Run();
    }
    protected override void localLoadRes(object[] objs)
    {
        callback = objs[0] as CallBackWithParams <Object>;
        Object o = Resources.Load("Config/CharacterConfig");

        if (callback != null)
        {
            callback(o);
        }
    }
Ejemplo n.º 12
0
    protected override void webLoadRes(object[] objs)
    {
        tempData     = objs[0] as CharacterData;
        tempcallback = objs[1] as CallBackWithParams <Object>;

        if (tempData.sex == (int)EnumCharacterType.Charater_Female)
        {
            request = new SOAService_Resource_Character_Bundle_Female(resType, CharacterConst.Female);
        }
        else
        {
            request = new SOAService_Resource_Character_Bundle_Male(resType, CharacterConst.Male);
        }
        request.AddListener(LoadComplete);
        request.Run();
    }
Ejemplo n.º 13
0
    protected override void webLoadRes(object[] objs)
    {
        cm           = objs[0] as ClothModel;
        tempCallback = objs[1] as CallBackWithParams <Object>;


        if (cm.sex == "01")
        {
            request = new SOAService_Resource_Character_Bundle_Male(resType, cm.resname);
        }
        else
        {
            request = new SOAService_Resource_Character_Bundle_Female(resType, cm.resname);
        }
        request.AddListener(LoadComplelte);
        request.Run();
    }
Ejemplo n.º 14
0
    protected override void localLoadRes(object[] objs)
    {
        cm           = objs[0] as ClothModel;
        tempCallback = objs[1] as CallBackWithParams <Object>;

        string sexFold = CharacterConst.Female;

        if (cm.sex == "01")
        {
            sexFold = CharacterConst.Male;
        }
        string prefab = string.Format("{0}/{1}/{2}/{3}", resType.ToString(), sexFold, cm.resname, cm.resname);

        Debug.Log(prefab);
        Object go = Resources.Load <Object>(prefab);

        tempCallback(go);
    }
Ejemplo n.º 15
0
    protected override void localLoadRes(object[] objs)
    {
        tempData     = objs[0] as CharacterData;
        tempcallback = objs[1] as CallBackWithParams <Object>;

        string sexFold = CharacterConst.Female;
        string name    = CharacterConst.Female;

        if (tempData.sex == (int)EnumCharacterType.Charater_Male)
        {
            sexFold = CharacterConst.Male;
            name    = CharacterConst.Male;
        }
        string prefab = string.Format("{0}/{1}/{2}", resType.ToString(), sexFold, name);

        Debug.Log(prefab);
        Object go = Resources.Load <Object>(prefab);

        tempcallback(go);
    }
Ejemplo n.º 16
0
	/// <summary>
	/// 发起支付
	/// </summary>
	/// <param name="paycode">Paycode.</param>
	/// <param name="paynum">Paynum.</param>
	/// <param name="ckFun">Ck fun.</param>
	public void Order (string paycode, string nameStr, CallBackWithParams<string> ckFun)
	{
		onCallBack = ckFun;

		EgameBinding.Order (paycode, nameStr);
	}
Ejemplo n.º 17
0
		static void OnBegin (CallBackWithParams<DataTable,List<string>> ckFun)
		{
			if (ckFun == null) return;
			ClearData ();
			List<string> readPathes = GetExcelPathes ();
			if (readPathes.Count == 0)
			{
				Debug.LogError ("未能找到Excel文件路径,请确保在Assets文件夹下面包含有正确Excel文件格式的“Vdata/Excel”文件夹。");
				return;
			}
			List<string> writePathes = GetWriteDirectories ();
			if (writePathes.Count == 0)
			{
				Debug.LogError ("未能找到" + SAVE_DIR_NAME + "输出路径,请确保在Assets文件夹下面包含有" + SAVE_DIR_NAME + "”文件夹。");
				return;
			}
			List<DataTable> tables = new List<DataTable> ();
			foreach (string path in readPathes)
			{
				tables.AddRange (GetExcelData (path));
			}

			foreach (DataTable table in tables)
			{
				ckFun (table, writePathes);
			}
			AssetDatabase.Refresh ();
		}
Ejemplo n.º 18
0
 public void AddListener(CallBackWithParams <ResponseData> call)
 {
     Callback += call;
 }