• 大小: 17.53MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-06-27
  • 语言: 其他
  • 标签: Unity3D  C#  游戏开发  

资源简介

Unity3d开发的微信跳一跳小游戏角色跳跃 相机跟随 台子自动生成死亡判定及重新开始游戏分数统计 色蓄力的粒子效果 角色蓄力效果 角色蓄力台子效果飘分效果 联网排行榜功能 翻倍加分功能

资源截图

代码片段和文件信息

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Networking.Types;

public class LeanCloudRestAPI
{
    public string AppId { get; set; }
    public string AppKey { get; set; }
    private readonly string _baseUrl;

    public LeanCloudRestAPI(string appId string appKey)
    {
        AppId = appId;
        AppKey = appKey;
        _baseUrl = BuildUrl(appId);
    }

    string BuildUrl(string appKey)
    {
        var prefix = appKey.Substring(0 8).ToLower();
        return string.Format(“https://{0}.api.lncld.net“ prefix);
    }

    public IEnumerator Create(string className string json Action calback)
    {
        var url = _baseUrl + “/1.1/classes/“ + className;
        using (var www = UnityWebRequest.Put(url json))
        {
            // Unity UnityWebRequest BUG 
            // see:https://forum.unity.com/threads/unitywebrequest-post-url-jsondata-sending-broken-json.414708/
            www.method = “POST“;

            www.SetRequestHeader(“Content-Type“ “application/json“);
            www.SetRequestHeader(“X-LC-Id“ AppId);
            www.SetRequestHeader(“X-LC-Key“ AppKey);
            yield return www.SendWebRequest();

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log(www.downloadHandler.text);
            }
            else
            {
                calback();
            }
        }
    }

    public IEnumerator Query(string className Dictionaryject> parameters Action calback)
    {
        var url = _baseUrl + “/1.1/classes/“ + className + “?“;
        var i = 0;
        foreach (var o in parameters)
        {
            if (i != 0)
                url += “&“;
            url += o.Key + “=“ + o.Value;
            i++;
        }

        using (var www = UnityWebRequest.Get(url))
        {
            www.SetRequestHeader(“X-LC-Id“ AppId);
            www.SetRequestHeader(“X-LC-Key“ AppKey);
            yield return www.SendWebRequest();
            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log(www.downloadHandler.text);
            }
            else
            {
                calback(www.downloadHandler.text);
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-06-12 12:57  Unity-JumpJump-master\
     目录           0  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\
     文件          54  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\.gitignore
     目录           0  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\
     文件         213  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant.meta
     目录           0  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\
     文件         213  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween.meta
     目录           0  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\
     文件      188148  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween.xml
     文件         192  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween.xml.meta
     文件      143872  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween.dll
     文件       55846  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween.dll.mdb
     文件         189  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween.dll.mdb.meta
     文件         369  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween.dll.meta
     文件        9728  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween43.dll
     文件        1789  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween43.dll.mdb
     文件         196  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween43.dll.mdb.meta
     文件         610  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween43.dll.meta
     文件        7080  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween43.xml
     文件         199  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween43.xml.meta
     文件       20480  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween46.dll
     文件        5901  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween46.dll.mdb
     文件         196  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween46.dll.mdb.meta
     文件         610  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween46.dll.meta
     文件       23310  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween46.xml
     文件         199  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween46.xml.meta
     文件        5632  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween50.dll
     文件         796  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween50.dll.mdb
     文件         196  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween50.dll.mdb.meta
     文件         610  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween50.dll.meta
     文件        6734  2018-06-12 12:57  Unity-JumpJump-master\JumpJump\Assets\Demigiant\DOTween\DOTween50.xml
............此处省略100个文件信息

评论

共有 条评论