• 大小: 58.64MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2022-11-07
  • 语言: 其他
  • 标签: unity2D  游戏  斗地主  

资源简介

里面是一个斗地主游戏的小项目,可以直接进行编译运行,自己写的,使用的方法里面有个文档有说明,有兴趣的可以玩一下

资源截图

代码片段和文件信息

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
using Protocol.Dto.Fight;

public class ShowGame 
 {
    //[MenuItem(“Tools/销毁所有玩家的手牌“)]
    //public static void DesAllCard()
    //{
    //    leftCardPar = Gameobject.Find(“LeftPlayer/CardPoint“).transform;
    //    RightCardPar = Gameobject.Find(“RightPlayer/CardPoint“).transform;
    //    MyCardPar = Gameobject.Find(“MyPlayer/CardPoint“).transform;
    //    for (int i = 0; i < leftCardPar.childCount; i++)
    //    {
    //       Gameobject. Destroy(leftCardPar.GetChild(i).gameobject);
    //    }

    //}
    [MenuItem(“Tools/刷新所有玩家的手牌“)]
    static void InitLefeAndRightCard()
    {
        initCardList();
    }
   static Transform leftCardPar;
   static Transform RightCardPar;
    static Transform MyCardPar;
    //初始化显示卡牌
    private  static  void  initCardList()
    {
        leftCardPar=Gameobject.Find (“LeftPlayer/CardPoint“).transform ;
        RightCardPar=Gameobject.Find(“RightPlayer/CardPoint“).transform;
        MyCardPar= Gameobject.Find(“MyPlayer/CardPoint“).transform;

        //Gameobject cardPrefab = Resources.Loadject>(“Card/OtherCard“);
        
        //for (int i = 0; i < 17; i++)
        //{
        //    createGo(i cardPrefableftCardPar);
           
        //}
        //for (int i = 0; i < 17; i++)
        //{
        //    createGo(i cardPrefab RightCardPar  );
           
        //}
        Gameobject MYcardPrefab = Resources.Loadject>(“Card/MyCard“);
        for (int i = 0; i < 17; i++)
        {
            createGo1(i MYcardPrefab MyCardPar);
        }
    }
    /// 
    /// 创建卡牌游戏物体
    /// 

    /// 
    /// 
    private static void createGo(int Index Gameobject cardPrefabTransform cardParent)
    {

        Gameobject cardGo = Gameobject.  Instantiate(cardPrefab cardParent) as Gameobject;
        cardGo.transform.localPosition = new Vector2((0.15f * Index) 0);
     
        cardGo.GetComponent().sortingOrder = Index + 1000;

    }
    private static void createGo1(int Index Gameobject cardPrefab Transform cardParent CardDto card=null  )
    {

        Gameobject cardGo = Gameobject.Instantiate(cardPrefab cardParent);

        cardGo.transform.localPosition = new Vector2((0.5f * Index) 0);
        cardGo.GetComponent().sortingOrder = Index + 1000;
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-05-02 09:47  斗地主\
     目录           0  2018-05-02 09:18  斗地主\Card\
     目录           0  2018-05-02 09:17  斗地主\Card\.vs\
     目录           0  2018-05-02 09:17  斗地主\Card\.vs\Card\
     目录           0  2018-05-02 09:17  斗地主\Card\.vs\Card\v14\
     文件      146432  2018-04-19 10:28  斗地主\Card\.vs\Card\v14\.suo
     目录           0  2018-05-02 09:17  斗地主\Card\.vs\Card\v15\
     文件       88576  2017-08-20 01:05  斗地主\Card\.vs\Card\v15\.suo
     目录           0  2018-05-02 09:17  斗地主\Card\Assets\
     目录           0  2018-05-02 09:17  斗地主\Card\Assets\Editor\
     文件         191  2018-02-03 15:46  斗地主\Card\Assets\Editor.meta
     文件        2623  2018-02-03 16:19  斗地主\Card\Assets\Editor\ShowGame.cs
     文件         262  2018-02-03 15:46  斗地主\Card\Assets\Editor\ShowGame.cs.meta
     目录           0  2018-05-02 09:17  斗地主\Card\Assets\Plugins\
     文件         192  2017-08-10 18:52  斗地主\Card\Assets\Plugins.meta
     文件       13312  2018-02-24 17:15  斗地主\Card\Assets\Plugins\Protocol.dll
     文件        4344  2018-03-02 15:31  斗地主\Card\Assets\Plugins\Protocol.dll.mdb
     文件         174  2018-03-02 15:31  斗地主\Card\Assets\Plugins\Protocol.dll.mdb.meta
     文件         486  2018-01-03 18:13  斗地主\Card\Assets\Plugins\Protocol.dll.meta
     文件       46592  2018-02-24 17:15  斗地主\Card\Assets\Plugins\Protocol.pdb
     文件         174  2018-01-03 18:13  斗地主\Card\Assets\Plugins\Protocol.pdb.meta
     目录           0  2018-05-02 09:17  斗地主\Card\Assets\Prefabs\
     文件         192  2017-08-15 18:25  斗地主\Card\Assets\Prefabs.meta
     文件        4947  2017-08-15 18:25  斗地主\Card\Assets\Prefabs\PromptPanel.prefab
     文件         210  2017-08-15 18:25  斗地主\Card\Assets\Prefabs\PromptPanel.prefab.meta
     目录           0  2018-05-02 09:17  斗地主\Card\Assets\Res\
     文件         192  2017-08-07 15:04  斗地主\Card\Assets\Res.meta
     目录           0  2018-05-02 09:17  斗地主\Card\Assets\Resources\
     文件         191  2018-01-14 16:33  斗地主\Card\Assets\Resources.meta
     目录           0  2018-05-02 09:17  斗地主\Card\Assets\Resources\Card\
     文件         191  2018-01-29 18:14  斗地主\Card\Assets\Resources\Card.meta
............此处省略3900个文件信息

评论

共有 条评论