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

C# tk2dSprite类代码示例

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

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



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

示例1: Start

    // Use this for initialization
    void Start()
    {
        Sprite = GetComponent<tk2dSprite>();
        StartColor = GetComponent<tk2dSprite>().color;

        StartCoroutine(FadeHole(FadeTime));
    }
开发者ID:newmanwillis,项目名称:Dead_Week,代码行数:8,代码来源:ZombieHole.cs


示例2: Start

	void Start()
	{
		toggleHealthButton = GameObject.Find("HealthBarToggleButton").GetComponent<UIButton>();
		healthButton = GameObject.Find("HealthBarToggleButton").GetComponent<tk2dSprite>();
		
		SetButton();
	}
开发者ID:stevesolomon,项目名称:MicroDungeonPrototype,代码行数:7,代码来源:HealthBarGUIManager.cs


示例3: Start

	// Use this for initialization
	void Start () 
	{
		if (viewCamera == null)
			viewCamera = GameObject.Find("GUIBoxCamera").GetComponent<Camera>();
		
		sprite = GetComponent<tk2dSprite>();
		
		// Change this to use animated sprites if necessary
		// Same concept here, lookup Ids and call Play(xxx) instead of .spriteId = xxx
		buttonDownSpriteId = sprite.GetSpriteIdByName(buttonDownSprite);
		buttonUpSpriteId = sprite.GetSpriteIdByName(buttonUpSprite);
		buttonPressedSpriteId = sprite.GetSpriteIdByName(buttonPressedSprite);
		
		if (collider == null)
		{
			BoxCollider newCollider = gameObject.AddComponent<BoxCollider>();
			Vector3 colliderExtents = newCollider.extents;
			colliderExtents.z = 0.2f;
			newCollider.extents = colliderExtents;
		}	
		
		monsterSprite = transform.FindChild("MonsterImage").GetComponent<tk2dSprite>();
		monsterSprite.enabled = false;
		LoadMonster();
		
		StartCoroutine(coHandleMouseEnter());
	}
开发者ID:stevesolomon,项目名称:MicroDungeonPrototype,代码行数:28,代码来源:MonsterSelectBox.cs


示例4: DoTransparency

	public static IEnumerator DoTransparency(tk2dSprite[] sprite, float time, CallBackPtr callbackPtr = null){
		Color orinColor = new Color(1, 1, 1, 0);//sprite.color;
		Color targetColor = new Color(1, 1, 1, 1);
		Color curSrcColor;
		Color curTargetColor;
		int reverseCount = 16 * (int)time;
		for(int i = 0; i < reverseCount; i++){
			if((i & 1) == 0){
				curSrcColor = new Color(orinColor.r, orinColor.g, orinColor.b, orinColor.a);
				curTargetColor = new Color(targetColor.r, targetColor.g, targetColor.b, targetColor.a);
			}
			else{
				curSrcColor = new Color(targetColor.r, targetColor.g, targetColor.b, targetColor.a);
				curTargetColor = new Color(orinColor.r, orinColor.g, orinColor.b, orinColor.a);
			}
			for(float t = 0; t < time / reverseCount; t += tk2dUITime.deltaTime){
				float nt = Mathf.Clamp01( t / (time / reverseCount) );
				nt = Mathf.Sin(nt * Mathf.PI * 0.5f);
				for(int j = 0; j < sprite.Length; j++)
					sprite[j].color = Color.Lerp(curSrcColor, curTargetColor, nt);
				yield return 0;
			}
		}
		for(int j = 0; j < sprite.Length; j++)
			sprite[j].color = targetColor;//Color.Lerp(curSrcColor, curTargetColor, nt);
		if(callbackPtr != null)
			callbackPtr();
	}
开发者ID:21garam,项目名称:SW_Maestro,代码行数:28,代码来源:Effect_.cs


示例5: Start

 void Start()
 {
     sprite = GetComponent<tk2dSprite>();
     player = GameObject.FindGameObjectWithTag("Player");
     OldX = transform.position.x;
     OldY = transform.position.y;
 }
开发者ID:ninjasky3,项目名称:jumpplatformer,代码行数:7,代码来源:PlatformMove.cs


示例6: Start

    void Start()
    {
        mState1 = State1.ScaleUp;
        mState2_IsFadingOut = false;
        mShakeDirects = new Vector3[]{
                        new Vector3(-1F,1F,0F)
                        ,new Vector3(1F,-1.2F,0F)
                        ,new Vector3(1.2F,1F,0F)
                        ,new Vector3(-1.2F,-0.8F,0F)
                };

        mSprWeb = Pool_GameObj.GetObj(Prefab_GoSpriteWeb).GetComponent<tk2dSprite>();
        if (NameSprite != null && NameSprite != "")
            mSprWeb.spriteId = mSprWeb.GetSpriteIdByName(NameSprite);
        Transform ts = mSprWeb.transform;
        mSprWeb.gameObject.SetActive(true);
        ts.parent = transform;
        ts.localPosition = Vector3.zero;
        Color c = ColorInitialize;
        c.a = 1F;
        mSprWeb.color = c;
        mTsWeb = ts;

        mTimeWaitFadeout = TimeWebScaleUp + TimeShake - TimeFadeOut;
        mColorWeb = mSprWeb.color;
    }
开发者ID:minh3d,项目名称:Fish,代码行数:26,代码来源:Ef_WebBoom.cs


示例7: _Coro_BubbleScaleUp

    IEnumerator _Coro_BubbleScaleUp(tk2dSprite spr)
    {
        //������ɫ
        Color c = spr.color;
        c.a = AlphaStart;
        spr.color = c;

        float elapse = 0F;
        //�Ŵ�
        Transform tsSpr = spr.transform;
        float scaleUpTime = TimeOneBubble * 0.7F;
        while (elapse < scaleUpTime)
        {
            tsSpr.localScale = (ScaleTarget * (0.5F + elapse / scaleUpTime * 0.5F)) * Vector3.one;
            elapse += Time.deltaTime;
            yield return 0F;
        }
        tsSpr.localScale = Vector3.one * ScaleTarget;
        //����
        elapse = 0F;
        float fadeoutTime = TimeOneBubble * 0.3F;

        while (elapse < fadeoutTime)
        {
            c.a = (1F - elapse / fadeoutTime) * AlphaStart;
            spr.color = c;
            elapse += Time.deltaTime;
            yield return 0F;
        }

        //ɾ��
        spr.gameObject.SetActive(false);
        Pool_GameObj.RecycleGO(Prefab_Bubble.gameObject, spr.gameObject);
        //Destroy(spr.gameObject);
    }
开发者ID:minh3d,项目名称:Fish,代码行数:35,代码来源:Ef_WebBubble.cs


示例8: Awake

	void Awake() {
		sprite = GetComponent<tk2dSprite>();

		if (textMesh == null || textMesh.transform.parent != transform) {
			Debug.LogError("Text mesh must be assigned and parented to player.");
			enabled = false;
		}

		textMeshOffset = textMesh.transform.position - transform.position;
		textMesh.transform.parent = null;

		textMeshLabel.text = "instructions";
		textMeshLabel.Commit();

		if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsWebPlayer ||
			Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.OSXWebPlayer || Application.platform == RuntimePlatform.OSXDashboardPlayer) {
			textMesh.text = "LEFT ARROW / RIGHT ARROW";
		}
		else {
			textMesh.text = "TAP LEFT / RIGHT SIDE OF SCREEN";
		}
		textMesh.Commit();

		Application.targetFrameRate = 60;
	}
开发者ID:berenkusmenoglu,项目名称:Core,代码行数:25,代码来源:tk2dTileMapDemoPlayer.cs


示例9: UpdateSelectedInfo

 public void UpdateSelectedInfo()
 {
     this.bgSprite = base.GetComponent<tk2dSprite>();
     this.button = base.GetComponent<tk2dButton>();
     if (this.isSelected)
     {
         this.button.enabled = false;
         this.button.StopAllCoroutines();
         this.button.buttonDown = false;
         this.bgSprite.SetSprite(this.selectedSpriteName);
         Vector3 localPosition = this.bgSprite.transform.localPosition;
         localPosition.y = this.selectedPositionY;
         this.bgSprite.transform.localPosition = localPosition;
     }
     else
     {
         this.button.enabled = true;
         this.button.StopAllCoroutines();
         this.button.buttonDown = false;
         this.bgSprite.SetSprite(this.normalSpriteName);
         Vector3 vector2 = this.bgSprite.transform.localPosition;
         vector2.y = this.normalPositionY;
         this.bgSprite.transform.localPosition = vector2;
     }
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:25,代码来源:FleetSelectButton.cs


示例10: configureObject

    public void configureObject(tk2dSprite sprite, string resGroup, string spriteName)
    {
        if (!_spriteCollections.ContainsKey(resGroup))
            loadSpriteCollection(resGroup);

        sprite.SwitchCollectionAndSprite(_spriteCollections[resGroup].spriteCollection, _spriteCollections[resGroup].spriteCollection.GetSpriteIdByName(spriteName));
    }
开发者ID:DieselPuppet,项目名称:DatingDash,代码行数:7,代码来源:ContentManager.cs


示例11: Start

 // Use this for initialization
 void Start()
 {
     anim = GetComponent<tk2dSpriteAnimator>();
     anim.Play("walking");
     distToGround = collider.bounds.extents.y;
     gravityTotal = gravity;
     sprite = GetComponent<tk2dSprite>();
 }
开发者ID:poemdexter,项目名称:2DToolkit-Game,代码行数:9,代码来源:DoctorScript.cs


示例12: Start

    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
        actionText = this.transform.FindChild("Action Text").GetComponent<tk2dTextMesh>();
        actionButton = this.transform.FindChild("Action Button").GetComponent<tk2dSprite>();

        timeLeftUntilFade = maxTimeUntilFade;
    }
开发者ID:rllamas,项目名称:Quantum,代码行数:9,代码来源:ActionGUI.cs


示例13: Start

    void Start()
    {
        sprite = GetComponent<tk2dSprite>();
        //healthText = FindChild(gameObject.name, "HealthText").GetComponent<tk2dTextMesh>();

        health = startHealth;
        isAlive = true;
    }
开发者ID:jpann,项目名称:MissileDefense,代码行数:8,代码来源:StructureController.cs


示例14: Awake

 // Use this for initialization
 void Awake()
 {
     timer = this.GetComponent<Timer> ();
     audioSource = this.GetComponent<AudioSource> ();
     timer.Init ();
     timer.AddEvent(new Timer.TimerEvent(this.ScaleSprite, secondsBetweenPlayAndScale, true));
     sprite = this.GetComponent<tk2dSprite> ();
 }
开发者ID:savethejets,项目名称:Ludum-Dare-29,代码行数:9,代码来源:PlaySoundAndScale.cs


示例15: Start

 private void Start()
 {
     if (this.sprite == null)
     {
         this.sprite = base.GetComponent<tk2dSprite>();
     }
     this.SetIcon();
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:8,代码来源:UpdateFormatioinIcon.cs


示例16: Start

 // Use this for initialization
 void Start()
 {
     sprite = GetComponent<tk2dSprite> ();
     myTransform = transform;
     startingPos = myTransform.position;
     if (direction == Direction.RANDOM) {
         direction = (Direction) Random.Range(1, 3);
     }
 }
开发者ID:jamiltron,项目名称:ggj2014,代码行数:10,代码来源:SimpleDuckController.cs


示例17: Start

    void Start()
    {
        objSprite = GetComponent<tk2dSprite>();

        objColor = Color.white;
        objColor.a = 0.0000f;

        isFadingIn = true;
    }
开发者ID:jpann,项目名称:MissileDefense,代码行数:9,代码来源:TurretTargetController.cs


示例18: Setup

        public void Setup(SpriteFlatData data)
        {
            _data = data;
            _sprite = gameObject.AddComponent<tk2dSprite>();
            _sprite.SwitchCollectionAndSprite(data.data, 0);
            _sprite.Build();

            _dimensionsInit = new Vector3(data.regionWidth, data.regionHeight, 1f);
            dimensions = new Vector3(data.width, data.height, 1f);
        }
开发者ID:hjrhjr,项目名称:Beats2,代码行数:10,代码来源:SpriteFlat.cs


示例19: Awake

	void Awake()
	{
//		lineRenderer = GetComponent<LineRenderer>();
//		lineRenderer.useWorldSpace = false;
		sprite = GetComponent<tk2dSprite>();
		sprite.SetSprite( GestureTemplate.name );
		sprite.color = runeColor;
		OnCreate();
		wakeTime = Time.time;
	}
开发者ID:AtwoodDeng,项目名称:GGJ2015,代码行数:10,代码来源:Rune.cs


示例20: Awake

    //private Player
    void Awake()
    {
        this.cameraOne = GetComponentInChildren<PlayerOneCamera>();
        this.cameraTwo = GetComponentInChildren<PlayerTwoCamera>();

        this.playerOne = GameObject.Find("Player1");
        this.playerTwo = GameObject.Find("Player2");

        this.transitionCard = GameObject.Find("TransitionCard").gameObject.GetComponent<tk2dSprite>();
    }
开发者ID:AndrewCarvalho,项目名称:Tojam8,代码行数:11,代码来源:CameraController.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# tk2dSpriteAnimationClip类代码示例发布时间:2022-05-24
下一篇:
C# tk2dCamera类代码示例发布时间: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