当前位置: 首页>>代码示例>>C#>>正文


C# UIAtlas类代码示例

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


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


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