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


C# Button.Select方法代码示例

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


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

示例1: Start

//--------------------------------------------------------------------------------------------

	void Start()
	{
		mSavedGameManager = SavedGameManager.createOrLoadSavedGameManager(gmPrefab).GetComponent<SavedGameManager>();

		//if the current game ptr is somehow bad, return to the main menu
		if(mSavedGameManager.getCurrentGame() == null)
		{
			Debug.Log("ERROR: CURRENT GAME PTR NULL -- LOADING MAIN MENU");
			SceneManager.LoadScene((int)SceneIndex.MAIN_MENU);
			return;
		}

		//init the sprite arrays
		levelTitleSprites = Resources.LoadAll<Sprite>("GUI_Assets/LevelTitles");
		levelButtonSprites = Resources.LoadAll<Sprite>("GUI_Assets/LevelButtonIcons");
		levelImgSprites = Resources.LoadAll<Sprite>("GUI_Assets/WorldIcons");
		stageButtonSprites = Resources.LoadAll<Sprite>("GUI_Assets/StageButtonIcons");

		//hide classified levels / worlds
		setLevelButtonsClassified();

		//need to get a handle on the final chassis stars
		finalChassisStars = mStagePanel.GetComponentsInChildren<FinalChassisStar>();

		//tutorial always unlocked, init menu to this
		lastButtonClicked = mLevelPanel.GetComponentInChildren<Button>();
		lastButtonClicked.Select();
		handleLevelButtonMouseOver(0);

		//sanity check -- null any selected level data on the current game ptr
		mSavedGameManager.getCurrentGame().setSelectedLevel(SceneIndex.NULL);
		mSelectedLevel = SceneIndex.NULL;

		StartCoroutine(mScreenFader.FadeFromBlack());
	}
开发者ID:zachary-goodless,项目名称:Cull-the-Swarm,代码行数:37,代码来源:WorldMapEventHandler.cs

示例2: LaserPointer_PointerIn

    private void LaserPointer_PointerIn(object sender, PointerEventArgs e)
    {
        if (e.target.gameObject.GetComponent<Button>() != null && btn == null)
        {

            btn = e.target.gameObject.GetComponent<Button>();
            btn.Select();

            pointerOnButton = true;

        }
    }
开发者ID:youdiaozi,项目名称:AudioSword,代码行数:12,代码来源:LaserButtonClicker.cs

示例3: Start

    void Start()
    {
        //DontDestroyOnLoad(this);
        Cursor.visible = false;

        difficultyOutput = GameObject.Find("Difficulty Output").GetComponent<Text>();
        difficultySlider = GameObject.Find("Difficulty").GetComponent<Slider>();
        playButton = GameObject.Find("Play").GetComponent<Button>();
        LastplayerPick = GameObject.Find("Pale").GetComponent<Toggle>().isOn;
        FirstChar = LastplayerPick;
        playButton.Select();
    }
开发者ID:Shask,项目名称:WonderJam-October2015,代码行数:12,代码来源:MenuCtrl.cs

示例4: Start

	// Use this for initialization
	void Start () {
		ControlMenu.enabled = false;
		startText = startText.GetComponent<Button> ();
		startText.image.enabled = false;
		ControlsText.image.enabled = false;
	//	exitText = exitText.GetComponent<Button> ();
		exitMenuText = exitMenuText.GetComponent<Button> ();
		startText.image.enabled = true;
		ControlsText.image.enabled = true;
		//SplashCanvas.enabled=true;
		//splashScreen =SplashCanvas.GetComponent<RectTransform> ();
		//splashScreen.sizeDelta = new Vector2 (800, 285);
		//splashScreen.localPosition.Set(382f, 136f, 0f);
		//startText.enabled = false;
		//ControlsText.enabled = false;
		startText.Select ();

	}
开发者ID:JeffreyByJeffrey,项目名称:Ghost,代码行数:19,代码来源:MenuScript.cs

示例5: Update

 void Update()
 {
     if (Input.GetKeyDown(KeyCode.UpArrow))
     {
         swap = other;
         other = current;
         current = swap;
         current.Select();
     }
     if (Input.GetKeyDown(KeyCode.DownArrow))
     {
         swap = other;
         other = current;
         current = swap;
         current.Select();
     }
     if (Input.GetKey(KeyCode.Return))
     {
         current.onClick.Invoke();
     }
 }
开发者ID:pli41,项目名称:CasketClosed,代码行数:21,代码来源:KeyButton.cs

示例6: SetButtonFocus

 public void SetButtonFocus(Button focus)
 {
     EventSystem.current.SetSelectedGameObject (null);
     focus.Select ();
 }
开发者ID:NealKaviratna,项目名称:CS4455,代码行数:5,代码来源:MenuCameraMovement.cs

示例7: Start

    void Start()
    {
        b = GetComponent<Button>();

        b.Select();
    }
开发者ID:TrentonPottruff,项目名称:tcotii,代码行数:6,代码来源:DefaultSelectedButton.cs

示例8: ActiveMenu

 // Effet qui doit apparaître pour tous les boutons : sons, effets...
 private void ActiveMenu(Button menu)
 {
     CleanMenu (menu);
     menu.Select ();
     sfxSound.ButtonYesClick ();
 }
开发者ID:lpointet,项目名称:runblobby,代码行数:7,代码来源:MainMenuManager.cs

示例9: Start

 void Start()
 {
     current = one;
     other = two;
     current.Select();
 }
开发者ID:pli41,项目名称:CasketClosed,代码行数:6,代码来源:KeyButton.cs

示例10: Update

    private void Update()
    {
        /*
        if(Time.time < (startTime + waitTime))
            return;
        */
        if(choice == true && inputHandler.DPadHorizontal != 0 || inputHandler.HorizontalAxis != 0)
        {
            float dir = 0;
            if(inputHandler.DPadHorizontal != 0)
                dir = inputHandler.DPadHorizontal;
            else dir = inputHandler.HorizontalAxis;

            if(dir > 0)
            {
                if(currentlySelectedButton != ChoiceObject.GetComponent<RectTransform>().GetChild(0).GetComponent<Button>())
                {
                    currentlySelectedButton = ChoiceObject.GetComponent<RectTransform>().GetChild(0).GetComponent<Button>();
                    currentlySelectedButton.Select();
                }
            }

            if(dir < 0)
            {
                if(currentlySelectedButton != ChoiceObject.GetComponent<RectTransform>().GetChild(1).GetComponent<Button>())
                {
                    currentlySelectedButton = ChoiceObject.GetComponent<RectTransform>().GetChild(1).GetComponent<Button>();
                    currentlySelectedButton.Select();
                }
            }

            /*
            StartCoroutine( CutscenePartII() );
            ChoiceObject.SetActive(false);
            choice = false;
            */
        }

        if(choice == true && inputHandler.isInteract() && currentlySelectedButton != null)
        {
            ChoiceObject.SetActive(false);
            StartCoroutine( CutscenePartII() );

            choice = false;
        }

        /*	if( currentEnemyCount == 0 && spawnersSpawning == 0 && !eventCompleted)
        {
            StartCoroutine( WaitForTime() );
            eventCompleted = true;
        }*/
    }
开发者ID:mprofGamesDev-Dreams,项目名称:dreams,代码行数:52,代码来源:EnemyCounterSingleton.cs


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