本文整理汇总了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());
}
示例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;
}
}
示例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();
}
示例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 ();
}
示例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();
}
}
示例6: SetButtonFocus
public void SetButtonFocus(Button focus)
{
EventSystem.current.SetSelectedGameObject (null);
focus.Select ();
}
示例7: Start
void Start()
{
b = GetComponent<Button>();
b.Select();
}
示例8: ActiveMenu
// Effet qui doit apparaître pour tous les boutons : sons, effets...
private void ActiveMenu(Button menu)
{
CleanMenu (menu);
menu.Select ();
sfxSound.ButtonYesClick ();
}
示例9: Start
void Start()
{
current = one;
other = two;
current.Select();
}
示例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;
}*/
}