本文整理汇总了C#中Word.SetFocus方法的典型用法代码示例。如果您正苦于以下问题:C# Word.SetFocus方法的具体用法?C# Word.SetFocus怎么用?C# Word.SetFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Word
的用法示例。
在下文中一共展示了Word.SetFocus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetLetterFocus
/* modes
* Type 0
* Click 1
* Clue 2
*/
public void SetLetterFocus(Transform l, int mode)
{
if(mode==2)
{
if(word!=null)
if(word!=l.parent.GetComponent<Word>())
word.SetFocus(false);
letter = l.GetComponent<Letter>();
word = l.parent.GetComponent<Word>();
if(gameMode!=_View)
letterFocus.transform.position = l.position;
word.SetFocus(true);
clueFocus.transform.position = word.clueScript.transform.position;
clueFocus.transform.localScale = (word.clueScript.GetComponent<BoxCollider>()).size/0.002604167f*20f;
}
if(letter==null&&word!=null)
{
word.SetFocus(false);
word = null;
}
else
{
Letter newLetter = l.GetComponent<Letter>();
// if clicked/pressed
if(mode==1)
{
// if you click another letter that isn't in the word
if(newLetter.transform.parent.GetComponent<Word>() != word)
{
// and it has a twin
if(newLetter.twin != null)
{
// if the twin of clicked is current letter, swap to clicked from new word
if(newLetter.twin != letter)
{
newLetter = newLetter.twin;
}
}
}
// if you click the same letter
else if(newLetter == letter)
{
if(letter.twin != null)
newLetter = letter.twin;
}
}
// set letter and focus
letter = newLetter;
if(gameMode!=_View)
letterFocus.transform.position = l.position;
// sets word and clue focus if selecting another word
if(word!=null)
if(letter.transform.parent.GetComponent<Word>() != word)
word.SetFocus(false);
word = letter.transform.parent.GetComponent<Word>();
word.SetFocus(true);
clueFocus.transform.position = word.clueScript.transform.position;
clueFocus.transform.localScale = (word.clueScript.GetComponent<BoxCollider>()).size/0.002604167f*20f;
}
}