资源简介
是一个完整的unity斗地主项目,很适合新手入门教学,很值
代码片段和文件信息
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
///
/// Inspector class used to edit Inventory Databases.
///
[CustomEditor(typeof(InvDatabase))]
public class InvDatabaseInspector : Editor
{
static int mIndex = 0;
bool mConfirmDelete = false;
///
/// Draw an enlarged sprite within the specified texture atlas.
///
public Rect DrawSprite (Texture2D tex Rect sprite Material mat) { return DrawSprite(tex sprite mat true 0); }
///
/// Draw an enlarged sprite within the specified texture atlas.
///
public Rect DrawSprite (Texture2D tex Rect sprite Material mat bool addPadding)
{
return DrawSprite(tex sprite mat addPadding 0);
}
///
/// Draw an enlarged sprite within the specified texture atlas.
///
public Rect DrawSprite (Texture2D tex Rect sprite Material mat bool addPadding int maxSize)
{
float paddingX = addPadding ? 4f / tex.width : 0f;
float paddingY = addPadding ? 4f / tex.height : 0f;
float ratio = (sprite.height + paddingY) / (sprite.width + paddingX);
ratio *= (float)tex.height / tex.width;
// Draw the checkered background
Color c = GUI.color;
Rect rect = NGUIEditorTools.DrawBackground(tex ratio);
GUI.color = c;
if (maxSize > 0)
{
float dim = maxSize / Mathf.Max(rect.width rect.height);
rect.width *= dim;
rect.height *= dim;
}
// We only want to draw into this rectangle
if (Event.current.type == EventType.Repaint)
{
if (mat == null)
{
GUI.DrawTextureWithTexCoords(rect tex sprite);
}
else
{
// NOTE: DrawPreviewTexture doesn‘t seem to support BeginGroup-based clipping
// when a custom material is specified. It seems to be a bug in Unity.
// Passing ‘null‘ for the material or omitting the parameter clips as expected.
UnityEditor.EditorGUI.DrawPreviewTexture(sprite tex mat);
//UnityEditor.EditorGUI.DrawPreviewTexture(drawRect tex);
//GUI.DrawTexture(drawRect tex);
}
rect = new Rect(sprite.x + rect.x sprite.y + rect.y sprite.width sprite.height);
}
return rect;
}
///
/// Helper function that sets the index to the index of the specified item.
///
public static void SelectIndex (InvDatabase db InvbaseItem item)
{
mIndex = 0;
foreach (InvbaseItem i in db.items)
{
if (i == item) break;
++mIndex;
}
}
///
/// Draw the inspector widget.
///
public override void OnInspectorGUI ()
{
NGUIEditorTools.SetLabelWidth(80f);
InvDatabase db = target as InvDatabase;
NGUIEditorTools.DrawSeparator();
InvbaseItem item = null;
if (db.items == null || db.items.Count == 0)
{
mIndex = 0;
}
else
{
mIndex = Mathf.Clamp(mIndex 0 db.items.Count - 1);
item = db.items[mIndex];
}
if (mConfirmDelete)
{
// Show the confirmation dialog
GUILayout.Label(“Are you sure you want to delete ‘“ + item.name + “‘?“);
NGUI
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 85450 2016-06-01 10:04 斗地主源码(2017-11-15)\StartDouDiZhu\.vs\config\applicationhost.config
..A..H. 140288 2018-03-09 21:35 斗地主源码(2017-11-15)\StartDouDiZhu\.vs\StartDouDiZhu-csharp\v14\.suo
文件 12860 2017-11-10 10:31 斗地主源码(2017-11-15)\StartDouDiZhu\Assembly-CSharp-Editor-vs.csproj
文件 12854 2017-11-10 10:31 斗地主源码(2017-11-15)\StartDouDiZhu\Assembly-CSharp-Editor.csproj
文件 17061 2018-03-08 17:21 斗地主源码(2017-11-15)\StartDouDiZhu\Assembly-CSharp-vs.csproj
文件 17061 2017-11-10 14:44 斗地主源码(2017-11-15)\StartDouDiZhu\Assembly-CSharp.csproj
文件 4192 2017-11-10 10:27 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Altas\Poker.mat
..A..H. 95 2017-11-10 10:27 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Altas\Poker.mat.me
文件 492827 2017-11-10 10:27 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Altas\Poker.png
..A..H. 977 2017-11-10 10:27 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Altas\Poker.png.me
文件 11336 2017-11-10 10:35 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Altas\Poker.prefab
..A..H. 95 2017-11-10 10:27 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Altas\Poker.prefab.me
..A..H. 107 2017-11-10 10:18 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Altas.me
文件 326 2018-03-08 20:52 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\data.json
..A..H. 93 2017-11-13 09:45 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\data.json.me
文件 18209004 2015-07-10 19:00 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Fonts\SIMSUN.TTC
..A..H. 90 2017-11-10 20:25 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Fonts\SIMSUN.TTC.me
文件 1848672 2017-11-09 09:04 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Fonts\ygyxsziti2.0.ttf
..A..H. 301 2017-11-10 10:25 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Fonts\ygyxsziti2.0.ttf.me
..A..H. 107 2017-11-10 10:18 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\Fonts.me
文件 38460 2018-03-09 21:35 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\MainScene.unity
..A..H. 90 2017-11-10 10:35 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\MainScene.unity.me
文件 522240 2014-07-14 07:05 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\NGUI\Editor\FreeType.dll
..A..H. 90 2017-11-10 10:20 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\NGUI\Editor\FreeType.dll.me
文件 1089968 2014-07-14 07:05 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\NGUI\Editor\FreeType.dylib
..A..H. 90 2017-11-10 10:20 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\NGUI\Editor\FreeType.dylib.me
文件 15578 2014-07-14 07:06 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\NGUI\Editor\Preview\Control - Background.png
..A..H. 981 2017-11-10 10:20 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\NGUI\Editor\Preview\Control - Background.png.me
文件 18984 2014-07-14 07:06 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\NGUI\Editor\Preview\Control - Colored Button.png
..A..H. 981 2017-11-10 10:20 斗地主源码(2017-11-15)\StartDouDiZhu\Assets\NGUI\Editor\Preview\Control - Colored Button.png.me
............此处省略1740个文件信息
- 上一篇:普中单片机开发工具.rar
- 下一篇:广联达深思全国 全行业写锁及授权.rar
相关资源
- 三个安卓小游戏源码.rar
- ios-swift 版 俄罗斯方块.zip
- 简单的飞机游戏源码及素材
- unity3dFPS狙击游戏源码
- 微信公众H5娱乐小游戏龙虎斗微信游戏
- 高级完整塔防游戏源码
- 财神到游戏源码
- Unity3D掷筛子游戏源码
- flash as3连连看游戏源码
- 简单祖玛游戏源码
- pygame实现的弹珠游戏源码
- Unity无限酷跑游戏源码
- cocos2d-x游戏源码236061
- iOS象棋游戏源码
- 安卓拼图游戏源码
- 超级马里奥 小游戏源码
- QT版2048游戏源码
- 麻将游戏源码
- Unity3D射击游戏
- flash as3.0 空战游戏源码
- Flash祖玛游戏源代码
- 微信小游戏《守卫竹林》线上游戏源
- 微信小游戏《果蔬去哪了》线上游戏
- unity2D塔防游戏源码Tower+Defense+2D+0.9.
- unity 2D跳跃游戏源码
- unity2D塔防游戏源码Tower Defense 2D 0.9.
- 人机博弈 游戏源码解析以及基本搜索
- 15款Flash AS3.0游戏源码文件
- flash冰火人游戏源码
- 6款H5小游戏源码包含有五子棋 3d魔方
评论
共有 条评论