本文整理汇总了C#中tk2dSprite.SetSprite方法的典型用法代码示例。如果您正苦于以下问题:C# tk2dSprite.SetSprite方法的具体用法?C# tk2dSprite.SetSprite怎么用?C# tk2dSprite.SetSprite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tk2dSprite
的用法示例。
在下文中一共展示了tk2dSprite.SetSprite方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
void Awake()
{
// lineRenderer = GetComponent<LineRenderer>();
// lineRenderer.useWorldSpace = false;
sprite = GetComponent<tk2dSprite>();
sprite.SetSprite( GestureTemplate.name );
sprite.color = runeColor;
OnCreate();
wakeTime = Time.time;
}
示例2: DepleteHearts
// change the last full heart to empty
public void DepleteHearts()
{
if (currentHearts > 0)
{
currentHearts--;
for(int i = maxHearts; i > (currentHearts); i--)
{
heart = transform.FindChild("Heart"+i).GetComponent<tk2dSprite>();
heart.SetSprite("HeartEmpty");
heart.transform.localScale = new Vector3(2, 2, 1);
}
}
}
示例3: IncreaseHearts
// change the last empty heart to full (health pickup)
public void IncreaseHearts()
{
if (currentHearts < maxHearts)
{
currentHearts++;
for(int i = 1; i <= currentHearts; i++)
{
heart = transform.FindChild("Heart"+i).GetComponent<tk2dSprite>();
heart.SetSprite("HeartFull");
if(i == currentHearts)
{
heart.transform.localScale = new Vector3(2, 2, 1);
}
}
}
}
示例4: Start
// Use this for initialization
void Start()
{
timeTravelAnimator = this.transform.FindChild("Time Travel Animation").GetComponent<tk2dSpriteAnimator>();
//timePeriodText = this.transform.FindChild("Time Period Text").GetComponent<tk2dTextMesh>();
timePeriodImage = this.transform.FindChild("Time Period Image").GetComponent<tk2dSprite>();
timeTravelAnimator.gameObject.SetActive(true);
timeTravelAnimator.gameObject.SetActive(false);
playingAnimation = false;
if (LevelManager.IsFuture()) {
//timePeriodText.text = "future";
timePeriodImage.SetSprite("gui_future_text");
}
else {
//timePeriodText.text = "past";
timePeriodImage.SetSprite("gui_past_text");
}
//StartCoroutine("PlayTransitionAnimation");
}
示例5: Start
// Use this for initialization
void Start()
{
currentPageSprite = GetComponent<tk2dSprite>();
currentPageSprite.SetSprite("gui_tutorial_screen_01");
}
示例6: Initialize
public void Initialize(string spriteName){
m_sprite = transform.GetChild(0).GetComponent<tk2dSprite>();
m_sprite.SetSprite(spriteName);
size = new Vector2(m_sprite.GetUntrimmedBounds().size.x, m_sprite.GetUntrimmedBounds().size.y);
}