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


C# tk2dSprite.GetSpriteIdByName方法代码示例

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


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

示例1: 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

示例2: 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

示例3: OnEnable

    void OnEnable()
    {
        mSpr = GetComponent<tk2dSprite>();

        if (mSpr ==null ||SpriteNames == null || SpriteNames.Length == 0)
        {
            Debug.LogError("LocalPos_LanguageAutoSelect���������Աδ��ֵ����.");
            Destroy(this);
            return;
        }
        GameMain.EvtLanguageChange += Handle_LanguageChanged;
        mSpr.spriteId = mSpr.GetSpriteIdByName(SpriteNames[(int)GameMain.Singleton.BSSetting.LaguageUsing.Val]);
    }
开发者ID:minh3d,项目名称:Fish,代码行数:13,代码来源:SpriteID_LanguageAutoSelect.cs

示例4: Awake

	void Awake()
	{
		startWavePanel = GameObject.Find("WavePanel").GetComponent<UIInteractivePanel>();
		startWaveButton = GameObject.Find("startWaveButton").GetComponent<UIButton>();	
		
		waveInfoPanel = GameObject.Find("WaveInfoPanel").GetComponent<UIPanel>();
		waveInfoScrollList = GameObject.Find("WaveInfoScrollList").GetComponent<UIScrollList>();
		waveInfoPanel.BringIn();
		
		heroWaveManager = GameObject.Find("WaveManager").GetComponent<HeroWaveManager>();
		heroWaveManager.onAllWaveEnemiesDefeated += HandleAllWaveEnemiesDefeated;
		heroWaveManager.onNextWaveReady += HandleOnNextWaveReady;
		heroWaveManager.onSpawnNewHero += HandleOnSpawnNewHero;
		
		waveButton = GameObject.Find("startWaveButton").GetComponent<tk2dSprite>();
		waveButton.spriteId = waveButton.GetSpriteIdByName(waveStartButtonName);
	}
开发者ID:stevesolomon,项目名称:MicroDungeonPrototype,代码行数:17,代码来源:WaveGUIManager.cs

示例5: Start

    // Use this for initialization
    void Start()
    {
        if (viewCamera == null)
        {
            // Find a camera parent
            Transform node = transform;
            while (node && node.camera == null)
            {
                node = node.parent;
            }
            if (node && node.camera != null)
            {
                viewCamera = node.camera;
            }

            // ...otherwise, use the main camera
            if (viewCamera == null)
            {
                viewCamera = Camera.main;
            }
        }

        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;
        }
    }
开发者ID:CodeStrumpet,项目名称:Elemental,代码行数:39,代码来源:tk2dButton.cs

示例6: Start

    // Use this for initialization
    void Start()
    {
        // If we're generating from a seed
        if (seedGenerate)
            Random.seed = _currentSeed;
        _currentSeed = Random.seed;
        Random.seed = _currentSeed;

        _instance = this;

        _inventory = (GameObject.Find("inventory") as GameObject).GetComponent<Inventory>();

        _audioSource = GetComponent<AudioSource>();

        _floorSprite = GetComponentInChildren<tk2dSprite>();

        _popupText = (Instantiate(popupTextPrefab) as GameObject).GetComponent<tk2dTextMesh>();
        _popupText.transform.parent = transform;
        _popupText.gameObject.SetActive(false);

        _piecesToRemove = new List<GridPiece>();
        _piecesToDestroy = new List<GridPiece>();

        _gridWidth = Globals.ROOM_WIDTH;
        _gridHeight = Globals.ROOM_HEIGHT;

        _currentGame = new ProcGame();

        _currentRoom = _currentGame.startRoom;
        _player = _currentGame.player;
        _floorSprite.spriteId = _floorSprite.GetSpriteIdByName(_currentRoom.floorTilesName);
        _gridPieces = _currentRoom.gridPieces;
        foreach (GridPiece piece in _gridPieces) {
            piece.gameObject.SetActive(true);
        }

        // Begin the game
        addPlayerText("Hungry....");
    }
开发者ID:alect,项目名称:Puzzledice,代码行数:40,代码来源:PlayState.cs

示例7: ReceiveMoneyFromCustomer

    private IEnumerator ReceiveMoneyFromCustomer()
    {
        currentGamePlayState = GamePlayState.receiveMoney;

        if (cash_obj == null)
        {
            cash_obj = Instantiate(Resources.Load("Money/Cash", typeof(GameObject))) as GameObject;
            cash_obj.transform.position = new Vector3(0, 0, -5);
            cash_sprite = cash_obj.GetComponent<tk2dSprite>();

            if(currentCustomer.amount < 20) {
                cash_sprite.spriteId = cash_sprite.GetSpriteIdByName("cash_20");
                currentCustomer.payMoney = 20;
            }
            else if(currentCustomer.amount < 50) {
                cash_sprite.spriteId = cash_sprite.GetSpriteIdByName("cash_50");
                currentCustomer.payMoney = 50;
            }
            else if(currentCustomer.amount <= 100) {
                cash_sprite.spriteId = cash_sprite.GetSpriteIdByName("cash_100");
                currentCustomer.payMoney = 100;
            }
        }

        yield return new WaitForSeconds(3);

        Destroy(cash_obj.gameObject);
        calculator_group_instance.SetActiveRecursively(true);
        this.DeActiveCalculationPriceGUI();

        this.ShowGiveTheChangeForm();
        currentGamePlayState = GamePlayState.giveTheChange;

        if(MainMenu._HasNewGameEvent) {
            audioDescribe.PlayOnecSound(description_clips[6]);
        }
    }
开发者ID:mzget,项目名称:TK_SushiShop,代码行数:37,代码来源:SushiShop.cs

示例8: Awake

    void Awake()
    {
        sceneController = GameObject.FindGameObjectWithTag("GameController").GetComponent<SheepBank>();

        topDonationButton_sprite = topDonateButton_Obj.GetComponent<tk2dSprite>();
        downDonationButton_sprite = downDonateButton_Obj.GetComponent<tk2dSprite>();
        //@!-- Find index of donation_button texture;
        activeDonationButton_id = topDonationButton_sprite.GetSpriteIdByName("Donate_button");
        unactiveDonationButton_id = topDonationButton_sprite.GetSpriteIdByName("Donate_button_unactive");
    }
开发者ID:mzget,项目名称:TK_SushiShop,代码行数:10,代码来源:DonationManager.cs


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