• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UIAtlas类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UIAtlas的典型用法代码示例。如果您正苦于以下问题:C# UIAtlas类的具体用法?C# UIAtlas怎么用?C# UIAtlas使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UIAtlas类属于命名空间,在下文中一共展示了UIAtlas类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Show

	/// <summary>
	/// Show the selection wizard.
	/// </summary>

	public static void Show (UIAtlas atlas, UISprite selectedSprite)
	{
		SpriteSelector comp = ScriptableWizard.DisplayWizard<SpriteSelector>("Select a Sprite");
		comp.mAtlas = atlas;
		comp.mSprite = selectedSprite;
		comp.mCallback = null;
	}
开发者ID:Burnknee,项目名称:IpadApp,代码行数:11,代码来源:SpriteSelector.cs


示例2: initialization

    public void initialization()
    {
        itemAtlas = Resources.Load("Atlas/ItemIcon Atlas", typeof(UIAtlas)) as UIAtlas;

        // 임의로한거
         /*   if(itemID == 0)
        {
            itemSpriteName = "Orc Armor - Boots";
        }
        else if(itemID == 1)
        {
            itemSpriteName = "Orc Armor - Bracers";
        }
        else if(itemID == 2)
        {
            itemSpriteName = "Orc Armor - Shoulders";
        }
        else if(itemID == 3)
        {
            itemSpriteName = "NGUI";
        }
        else if(itemID == 4)
        {
            itemSpriteName = "Window";
        }*/
    }
开发者ID:Reiie,项目名称:Creature_Race,代码行数:26,代码来源:csItem.cs


示例3: AtlasUsages

        public AtlasUsages(UIAtlas Atlas)
        {
            this.Atlas = Atlas;
              UsedSprites = new Dictionary<string, SpriteLink>();

              initUnusedSprites();
        }
开发者ID:renao,项目名称:UnityTools,代码行数:7,代码来源:AtlasUsages.cs


示例4: ChangeAtlas

 void ChangeAtlas(UIAtlas currentAtlas)
 {
     if(spriteName != "")
         sprite.spriteName = spriteName;
     sprite.atlas = currentAtlas;
     sprite.MakePixelPerfect();
 }
开发者ID:BBJV,项目名称:camachi,代码行数:7,代码来源:SetLanguage.cs


示例5: Validate

 public bool Validate(UIAtlas atlas)
 {
     if (atlas == null)
     {
         return false;
     }
     if (!this.mIsValid)
     {
         if (string.IsNullOrEmpty(this.spriteName))
         {
             return false;
         }
         this.mSprite = (atlas == null) ? null : atlas.GetSprite(this.spriteName);
         if (this.mSprite != null)
         {
             Texture texture = atlas.texture;
             if (texture == null)
             {
                 this.mSprite = null;
             }
             else
             {
                 this.mUV = new Rect((float) this.mSprite.x, (float) this.mSprite.y, (float) this.mSprite.width, (float) this.mSprite.height);
                 this.mUV = NGUIMath.ConvertToTexCoords(this.mUV, texture.width, texture.height);
                 this.mOffsetX = this.mSprite.paddingLeft;
                 this.mOffsetY = this.mSprite.paddingTop;
                 this.mWidth = this.mSprite.width;
                 this.mHeight = this.mSprite.height;
                 this.mAdvance = this.mSprite.width + (this.mSprite.paddingLeft + this.mSprite.paddingRight);
                 this.mIsValid = true;
             }
         }
     }
     return (this.mSprite != null);
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:35,代码来源:BMSymbol.cs


示例6: Load

	static void Load ()
	{
		mLoaded			= true;
		mPartial		= EditorPrefs.GetString("NGUI Partial");
		mFontName		= EditorPrefs.GetString("NGUI Font Name");
		mAtlasName		= EditorPrefs.GetString("NGUI Atlas Name");
		mFontData		= GetObject("NGUI Font Asset") as TextAsset;
		mFontTexture	= GetObject("NGUI Font Texture") as Texture2D;
		mFont			= GetObject("NGUI Font") as UIFont;
		mAtlas			= GetObject("NGUI Atlas") as UIAtlas;
		mAtlasPadding	= EditorPrefs.GetInt("NGUI Atlas Padding", 1);
		mAtlasTrimming	= EditorPrefs.GetBool("NGUI Atlas Trimming", true);
		mAtlasPMA		= EditorPrefs.GetBool("NGUI Atlas PMA", true);
		mUnityPacking	= EditorPrefs.GetBool("NGUI Unity Packing", true);
		mForceSquare	= EditorPrefs.GetBool("NGUI Force Square Atlas", true);
		mPivot			= (UIWidget.Pivot)EditorPrefs.GetInt("NGUI Pivot", (int)mPivot);
		mLayer			= EditorPrefs.GetInt("NGUI Layer", -1);
		mDynFont		= GetObject("NGUI DynFont") as Font;
		mDynFontSize	= EditorPrefs.GetInt("NGUI DynFontSize", 16);
		mDynFontStyle	= (FontStyle)EditorPrefs.GetInt("NGUI DynFontStyle", (int)FontStyle.Normal);

		if (mLayer < 0 || string.IsNullOrEmpty(LayerMask.LayerToName(mLayer))) mLayer = -1;

		if (mLayer == -1) mLayer = LayerMask.NameToLayer("UI");
		if (mLayer == -1) mLayer = LayerMask.NameToLayer("GUI");
		if (mLayer == -1) mLayer = 5;

		EditorPrefs.SetInt("UI Layer", mLayer);

		LoadColor();
	}
开发者ID:elainerezende,项目名称:Hearthstone,代码行数:31,代码来源:NGUISettings.cs


示例7: NGUIImage

 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="source">src attribute from img tag</param>
 /// <param name="fps">fps attribute from img tag</param>
 public NGUIImage(string source, int fps) {
   if ("#time".Equals(source, StringComparison.InvariantCultureIgnoreCase)) {
     isTime = true;
     timeFont = HtEngine.Device.LoadFont("code", 16, false, false, 0, 0);
   } else {
     string atlasName = source.Substring(0, source.LastIndexOf(':'));
     spriteName = source.Substring(source.LastIndexOf(':') + 1);
     isAnim = fps >= 0;
     FPS = fps;
    
     if (HtEngine.m_loadRes != null)
     {
         UnityEngine.GameObject _asset = HtEngine.m_loadRes(atlasName) as UnityEngine.GameObject;
         if (_asset != null)
         {
             uiAtlas = _asset.GetComponent<UIAtlas>();
         }
     }      
     else
     {
         uiAtlas = Resources.Load(atlasName, typeof(UIAtlas)) as UIAtlas;
     }
     if (uiAtlas == null)
     {
         Debug.LogWarning("Could not load html image atlas from " + atlasName + ":" + spriteName);
     }
   }
 }
开发者ID:fengqk,项目名称:Art,代码行数:33,代码来源:NGUIImage.cs


示例8: VerifyValidAtlas

 public bool VerifyValidAtlas(UIAtlas atlas)
 {
     if (atlas == currentCurrencyIcon.atlas)
         return true;
     else
         return false;
 }
开发者ID:hjupter,项目名称:CloudGoodsSDK,代码行数:7,代码来源:CreditBundleIcon.cs


示例9: CheckIfRelated

 public static bool CheckIfRelated(UIAtlas a, UIAtlas b)
 {
     if ((a == null) || (b == null))
     {
         return false;
     }
     return (((a == b) || a.References(b)) || b.References(a));
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:8,代码来源:UIAtlas.cs


示例10: init

	/// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	void init()
	{
		atlas_tile = Resources.Load<UIAtlas> (GameCon.basePipeAtlasPath);
		atlas_bgTiles = Resources.Load<UIAtlas> ("Atlases/BackgroundTiles");
		atlas_clockTiles = Resources.Load<UIAtlas> ("Atlases/TopClockTiles");
		atlas_counterTiles = Resources.Load<UIAtlas> ("Atlases/TopCounterTiles");
		atlas_textTiles = Resources.Load<UIAtlas> ("Atlases/TopTextTiles");
	}
开发者ID:eldon-dometita,项目名称:RAY,代码行数:9,代码来源:GlobalData.cs


示例11: Add

 /// <summary>
 /// Add a sprite appropriate for the specified atlas sprite.
 /// It will be a UISlicedSprite if the sprite has an inner rect, and a regular sprite otherwise.
 /// </summary>
 public static UISprite Add(GameObject go, UIAtlas atlas, string spriteName)
 {
     UIAtlas.Sprite sp = (atlas != null) ? atlas.GetSprite(spriteName) : null;
     UISprite sprite = (sp == null || sp.inner == sp.outer) ? NGUITools.AddWidget<UISprite>(go) : (UISprite)NGUITools.AddWidget<UISlicedSprite>(go);
     sprite.atlas = atlas;
     sprite.spriteName = spriteName;
     return sprite;
 }
开发者ID:light17,项目名称:Thunder,代码行数:12,代码来源:UISlicedSprite.cs


示例12: Set

 public static void Set(UIAtlas atlas, string sprite)
 {
     if (UICursor.instance != null && UICursor.instance.mSprite)
     {
         UICursor.instance.mSprite.atlas = atlas;
         UICursor.instance.mSprite.spriteName = sprite;
         UICursor.instance.mSprite.MakePixelPerfect();
         UICursor.instance.Update();
     }
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:10,代码来源:UICursor.cs


示例13: Set

	/// <summary>
	/// Override the cursor with the specified sprite.
	/// </summary>

	static public void Set(UIAtlas atlas, string sprite)
	{
		if (instance != null && instance.currentSprite)
		{
			instance.currentSprite.atlas = atlas;
			instance.currentSprite.spriteName = sprite;
			//instance.currentSprite.MakePixelPerfect();
			instance.Update();
		}
	}
开发者ID:Scoots,项目名称:HeroGame,代码行数:14,代码来源:OrbCursor.cs


示例14: Show

 /// <summary>
 /// 鏂板閫夋嫨绮剧伒 淇敼锛氭睙蹇楃ゥ 2013銆?4銆?4
 /// </summary>
 /// <param name="atlas"></param>
 /// <param name="selectedSprite"></param>
 /// <param name="callback"></param>
 public static void Show(UIAtlas atlas, string selectedSprite, SpriteArrayCallback callback, int ArrayID)
 {
     SpriteSelector comp = ScriptableWizard.DisplayWizard<SpriteSelector>("Select a Sprite");
     comp.mAtlas = atlas;
     comp.mSprite = null;
     comp.mName = selectedSprite;
     comp.mCallback = comp.OnSelectSpriteCallBackFuntion;
     comp.mArrayCallBack = callback;
     comp.SpriteID = ArrayID;
 }
开发者ID:Attila22,项目名称:LittleBard,代码行数:16,代码来源:SpriteSelector.cs


示例15: Set

 /// <summary>
 /// Override the cursor with the specified sprite.
 /// </summary>
 public static void Set(UIAtlas atlas, string sprite)
 {
     if (mInstance != null)
     {
         mInstance.mSprite.atlas = atlas;
         mInstance.mSprite.spriteName = sprite;
         mInstance.mSprite.MakePixelPerfect();
         mInstance.Update();
     }
 }
开发者ID:shinobushiva,项目名称:Perfume-Unity,代码行数:13,代码来源:UICursor.cs


示例16: Set

    public void Set( UIAtlas atlas, string sprite, object data, int _index )
    {
        mSprite.atlas = atlas;
        mSprite.spriteName = sprite;
        mSprite.MakePixelPerfect();

        userData = data;
        index = _index;

        Update();
    }
开发者ID:aminebenali,项目名称:dancing-cell-code,代码行数:11,代码来源:NvUICursor.cs


示例17: AddOrUpdate

 /// <summary>
 /// Add the specified texture to the atlas, or update an existing one.
 /// </summary>
 public static void AddOrUpdate(UIAtlas atlas, Texture2D tex)
 {
     if (atlas != null && tex != null)
     {
         List<Texture> textures = new List<Texture>();
         textures.Add(tex);
         List<SpriteEntry> sprites = CreateSprites(textures);
         ExtractSprites(atlas, sprites);
         UpdateAtlas(atlas, sprites);
     }
 }
开发者ID:hyf042,项目名称:BakeryGirl-chess,代码行数:14,代码来源:UIAtlasMaker.cs


示例18: LoadSpriteData

	/// <summary>
	/// Parse the specified JSon file, loading sprite information for the specified atlas.
	/// </summary>

	static public void LoadSpriteData (UIAtlas atlas, string jsonData)
	{
		if (string.IsNullOrEmpty(jsonData) || atlas == null) return;

		Hashtable decodedHash = jsonDecode(jsonData) as Hashtable;

		if (decodedHash == null)
		{
			Debug.LogWarning("Unable to parse the provided Json string");
		}
		else LoadSpriteData(atlas, decodedHash);
	}
开发者ID:OvertimeStudios,项目名称:CreepyBuster,代码行数:16,代码来源:NGUIJson.cs


示例19: AtlasHaveSprite

    public bool AtlasHaveSprite(UIAtlas atlas, string spriteName)
    {
        bool result = false;

        foreach (UISpriteData spriteData in atlas.spriteList)
        {
            if (spriteData.name == spriteName)
            {
                result = true;
            }
        }
        return result;
    }
开发者ID:GregLukosek,项目名称:NGUITools,代码行数:13,代码来源:NGUIMultiToolEditor.cs


示例20: Load

	static void Load ()
	{
		mLoaded			= true;
		mFontName		= EditorPrefs.GetString("NGUI Font Name");
		mAtlasName		= EditorPrefs.GetString("NGUI Atlas Name");
		mFontData		= GetObject("NGUI Font Asset") as TextAsset;
		mFontTexture	= GetObject("NGUI Font Texture") as Texture2D;
		mFont			= GetObject("NGUI Font") as UIFont;
		mAtlas			= GetObject("NGUI Atlas") as UIAtlas;
		mPreview		= EditorPrefs.GetInt("NGUI Preview") == 0;
		mAtlasPadding	= EditorPrefs.GetInt("NGUI Atlas Padding", 1);
		mAtlasTrimming	= EditorPrefs.GetBool("NGUI Atlas Trimming", true);
	}
开发者ID:BaeSangRyol,项目名称:match3action,代码行数:13,代码来源:UISettings.cs



注:本文中的UIAtlas类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UIAtlas.Sprite类代码示例发布时间:2022-05-24
下一篇:
C# UIApplication类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap