本文整理汇总了C#中tk2dUIItem类的典型用法代码示例。如果您正苦于以下问题:C# tk2dUIItem类的具体用法?C# tk2dUIItem怎么用?C# tk2dUIItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
tk2dUIItem类属于命名空间,在下文中一共展示了tk2dUIItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Clicked
void Clicked(tk2dUIItem clickedUIItem)
{
if(this.gameObject.name.Equals("Resume")){
//Debug.Log("Resuming game...");
pause.pauseGame();
pause.changeCamera();
}else if(this.gameObject.name.Equals("Main Menu")){
//transform.Find("LevelManager").gameObject.GetComponent<LevelManager>().LoadLevelSelect();
Application.LoadLevel("scene_title_with_level_select");
pause.pauseGame();
}else if(this.gameObject.name.Equals("Reset")){
//int level = transform.Find("LevelManager").gameObject.GetComponent<LevelManager>().GetCurrentLevelNumber();
Application.LoadLevel(Application.loadedLevelName);
pause.pauseGame();
}else if(this.gameObject.name.Equals("Map")){
if(!mapping){
mapping = true;
resume.SetActive(false);
reset.SetActive(false);
menu.SetActive(false);
}else{
mapping = false;
resume.SetActive(true);
reset.SetActive(true);
menu.SetActive(true);
}
}
}
开发者ID:rllamas,项目名称:Quantum,代码行数:28,代码来源:PauseGUI.cs
示例2: JoinServer
void JoinServer(tk2dUIItem clickedUIItem)
{
HostData host = clickedUIItem.gameObject.GetComponent<HostDataContainer>().hostData;
SetPlayerName();
if (Network.Connect(host) == NetworkConnectionError.NoError)
Application.LoadLevel("2DGame");
}
开发者ID:poemdexter,项目名称:2DToolkit-Game,代码行数:7,代码来源:TitleUIManager.cs
示例3: Clicked
void Clicked(tk2dUIItem clickedUIItem)
{
//if(!fade){
////Debug.Log("Clicked:" + clickedUIItem);
//iTween.MoveTo(this.gameObject, new Vector3( 0.0f,0.0f,-1.3f), 1.5f);
//}
}
开发者ID:rllamas,项目名称:Quantum,代码行数:7,代码来源:Tile.cs
示例4: FixColliderBounds
public static void FixColliderBounds( tk2dUIItem item ) {
HashSet<Transform> ignoreItems = new HashSet<Transform>( item.editorIgnoreBounds );
Transform root = item.transform;
Collider collider = item.GetComponent<Collider>();
Bounds b = GetRendererBoundsInChildren(root, ignoreItems, root, false);
foreach (Transform t in item.editorExtraBounds) {
if (t != null) {
Bounds b2 = GetRendererBoundsInChildren( root, ignoreItems, t, false );
if (b2.size != Vector3.zero) {
b.Encapsulate(b2);
}
}
}
BoxCollider boxCollider = collider as BoxCollider;
if (boxCollider != null) {
Undo.RegisterUndo(boxCollider, "Fit Collider");
b.extents = new Vector3(b.extents.x, b.extents.y, boxCollider.extents.z);
b.center = new Vector3(b.center.x, b.center.y, boxCollider.center.z);
boxCollider.extents = b.extents;
boxCollider.center = b.center;
}
SphereCollider sphereCollider = collider as SphereCollider;
if (sphereCollider != null) {
Undo.RegisterUndo(sphereCollider, "Fit Collider");
sphereCollider.center = new Vector3(b.center.x, b.center.y, 0);
sphereCollider.radius = Mathf.Max( b.extents.x, b.extents.y );
}
}
开发者ID:sundayliu,项目名称:HelloWorld-unity3d,代码行数:31,代码来源:tk2dUIItemBoundsHelper.cs
示例5: Start
void Start()
{
scriptPlayer = GameObject.Find("Monkey").GetComponent<Move>();
UI_Component = gameObject.AddComponent<tk2dUIItem>();
// Ajout d'un listener
UI_Component.OnClick += ClickManager.Instance.ClickOn_Desctructible;
}
开发者ID:Rodousse,项目名称:Projet-Omega,代码行数:8,代码来源:Caisse_Bois.cs
示例6: Clicked
void Clicked(tk2dUIItem clickedUIItem)
{
if(transform.tag.Equals("left"))
wheel.GetComponent<LevelSlide>().ScrollRight();
if(transform.tag.Equals("right"))
wheel.GetComponent<LevelSlide>().ScrollLeft();
}
开发者ID:rllamas,项目名称:Quantum,代码行数:8,代码来源:ButtonSlide.cs
示例7: CalculateClickWorldPos
private Vector3 CalculateClickWorldPos(tk2dUIItem btn)
{
Camera uICameraForControl = tk2dUIManager.Instance.GetUICameraForControl(base.gameObject);
Vector2 position = btn.Touch.position;
Vector3 vector2 = uICameraForControl.ScreenToWorldPoint(new Vector3(position.x, position.y, btn.transform.position.z - uICameraForControl.transform.position.z));
vector2.z = btn.transform.position.z;
return vector2;
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:8,代码来源:tk2dUIScrollbar.cs
示例8: ItemSelected
int ItemSelected(tk2dUIItem item)
{
//Debug.Log(item.transform.Find("WeaponName").GetComponent<tk2dTextMesh>().text);
int selected = testItemSelected.IndexOf(item.transform.parent);
Debug.Log(selected);
ScrollableArea.Value = ((float)selected + 0.5f) * scrollRate;
selectedItem = selected;
return selectedItem;
}
开发者ID:rjchart,项目名称:Project_YSS_2D,代码行数:11,代码来源:WeaponSceneController.cs
示例9: levelSelectedClicked
void levelSelectedClicked(tk2dUIItem item)
{
string levelName = item.name;
Regex regex = new Regex(@"Level[0-9]+");
Match match = regex.Match (levelName);
PlayerPrefs.SetInt (ScoreUtils.TOTAL_SCORE, 0);
PlayerPrefs.SetInt (ScoreUtils.LIVES, ScoreUtils.TOTAL_LIVES);
Application.LoadLevel ("LevelBase");
PlayerPrefs.SetString (ScoreUtils.LEVEL_USER_INIT, match.Value);
PlayerPrefs.SetString (ScoreUtils.CURRENT_LEVEL_USER, match.Value);
}
开发者ID:OscarRPR,项目名称:brick-breakout,代码行数:14,代码来源:LevelSelectionController.cs
示例10: OnClick
void OnClick(tk2dUIItem clickedUIItem)
{
/* If clicked center button. */
if (tiles[selectedLevel] == clickedUIItem.gameObject) {
/*
* TODO: Do checking for if the level is available.
* */
if (selectedLevel == 0) {
//iTween.ShakePosition(tiles[selectedLevel], new Vector3(Random.Range(-0.9f, 0.9f), Random.Range(-0.9f, 0.9f), Random.Range(-0.9f, 0.9f)), 2.0f);
LevelManager.LoadLevel(0);
}
}
}
开发者ID:rllamas,项目名称:Quantum,代码行数:15,代码来源:Wheel5.cs
示例11: CheckIsUIItemChildOfMe
public bool CheckIsUIItemChildOfMe(tk2dUIItem uiItem)
{
tk2dUIItem parentUIItem = null;
if (uiItem != null)
{
parentUIItem = uiItem.parentUIItem;
}
while (parentUIItem != null)
{
if (parentUIItem == this)
{
return true;
}
parentUIItem = parentUIItem.parentUIItem;
}
return false;
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:17,代码来源:tk2dUIItem.cs
示例12: OnClick
void OnClick(tk2dUIItem clickedUIItem)
{
/* If clicked center button. */
if (tiles[selectedLevel] == clickedUIItem.gameObject) {
/*
* TODO: Do checking for if the level is available.
* */
//iTween.ShakePosition(tiles[selectedLevel], new Vector3(Random.Range(-0.9f, 0.9f), Random.Range(-0.9f, 0.9f), Random.Range(-0.9f, 0.9f)), 2.0f);
Application.LoadLevel("level_select_group_" + selectedLevel);
//Debug.Log("Loading: level_select_group_" + selectedLevel);
// foreach (GameObject tile in tiles)
// tile.SetActive(false);
// transform.FindChild("LeftButton").gameObject.SetActive(false);
// transform.FindChild("RightButton").gameObject.SetActive(false);
transform.gameObject.SetActive(false);
}
}
开发者ID:rllamas,项目名称:Quantum,代码行数:19,代码来源:Wheel3.cs
示例13: CurrentOverUIItem
public void CurrentOverUIItem(tk2dUIItem overUIItem)
{
if (overUIItem != this)
{
if (this.isPressed)
{
if (!this.CheckIsUIItemChildOfMe(overUIItem))
{
this.Exit();
if (this.parentUIItem != null)
{
this.parentUIItem.CurrentOverUIItem(overUIItem);
}
}
}
else if (this.parentUIItem != null)
{
this.parentUIItem.CurrentOverUIItem(overUIItem);
}
}
}
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:21,代码来源:tk2dUIItem.cs
示例14: OnHardButtonClick
private void OnHardButtonClick(tk2dUIItem tk2dUiItem)
{
AppController.GetInstance().Difc = 1;
SceneManager.LoadScene(Constants.SCENE_GAME);
}
开发者ID:Insality,项目名称:GGJ16,代码行数:5,代码来源:MenuController.cs
示例15: CalculateClickWorldPos
private Vector3 CalculateClickWorldPos(tk2dUIItem btn)
{
Vector2 pos = btn.Touch.position;
Vector3 worldPos = tk2dUIManager.Instance.UICamera.ScreenToWorldPoint(new Vector3(pos.x, pos.y, btn.transform.position.z - tk2dUIManager.Instance.UICamera.transform.position.z));
worldPos.z = btn.transform.position.z;
return worldPos;
}
开发者ID:Trifectgaming,项目名称:2D-Runner,代码行数:7,代码来源:tk2dUIScrollbar.cs
示例16: HoverOut
/// <summary>
/// Hover out item.
/// Only call manually if you need to simulate touch.
/// </summary>
public void HoverOut(tk2dUIItem currHoverButton)
{
if (isHoverOver)
{
if (OnHoverOut != null) { OnHoverOut(); }
if (OnHoverOutUIItem != null) { OnHoverOutUIItem(this); }
isHoverOver = false;
}
if (parentUIItem != null && parentUIItem.isHoverEnabled)
{
if (currHoverButton == null)
{
parentUIItem.HoverOut(currHoverButton);
}
else
{
if (!parentUIItem.CheckIsUIItemChildOfMe(currHoverButton) && currHoverButton != parentUIItem)
{
parentUIItem.HoverOut(currHoverButton);
}
}
}
}
开发者ID:Ahere,项目名称:UnityIsometric,代码行数:29,代码来源:tk2dUIItem.cs
示例17: Handle_GameRank
void Handle_GameRank()
{
if (go_Rank==null)
{
go_Rank = Instantiate(Prefab_Rank) as GameObject;
EvtR += RankShow;
Light = go_Rank.transform.FindChild("back2").GetComponent<tk2dSprite>();
ChangeName = go_Rank.transform.FindChild("button/改名").GetComponent<tk2dUIItem>();
ChangeName.OnClick += SettingName;
// Debug.Log("订阅");
Light.transform.localPosition = new Vector3(-26, -167, -103);
go_Rank.transform.FindChild("button/fanhui").GetComponent<tk2dUIItem>().OnClick += Rank_BackClick;
}
else
{
go_Rank.SetActive(true);
}
}
开发者ID:minh3d,项目名称:Fish,代码行数:19,代码来源:Module_Rank.cs
示例18: Awake
void Awake() {
uiItem = GetComponent<tk2dUIItem>();
}
开发者ID:J0eCool,项目名称:ZephyrShot,代码行数:3,代码来源:BaseUiComponent.cs
示例19: HoverOver
/// <summary>
/// Hover over item. Return true if this was prevHover.
/// Only call manually if you need to simulate touch.
/// </summary>
public bool HoverOver(tk2dUIItem prevHover)
{
bool wasPrevHoverFound = false;
tk2dUIItem nextUIItem = null;
if (!isHoverOver)
{
if (OnHoverOver != null) { OnHoverOver(); }
if (OnHoverOverUIItem != null) { OnHoverOverUIItem(this); }
isHoverOver = true;
}
if (prevHover == this)
{
wasPrevHoverFound = true;
}
if (parentUIItem != null && parentUIItem.isHoverEnabled)
{
nextUIItem = parentUIItem;
}
if (nextUIItem == null)
{
return wasPrevHoverFound;
}
else
{
return nextUIItem.HoverOver(prevHover) || wasPrevHoverFound; //will return true once found
}
}
开发者ID:Ahere,项目名称:UnityIsometric,代码行数:34,代码来源:tk2dUIItem.cs
示例20: Press
/// <summary>
/// Touch press down (only call manually, if you need to simulate a touch). SentFromChild is the UIItem child it was sent from. If sentFromChild is
/// null that means it wasn't sent from a child
/// </summary>
/// /// <value>
/// return true if newly pressed
/// </value>
public bool Press(tk2dUITouch touch, tk2dUIItem sentFromChild) //pressed down ontop of button
{
if (isPressed)
{
return false; //already pressed
}
if (!isPressed)
{
this.touch = touch;
//if orginal press (not sent from child), or resgieterPressFromChildren is enabled
if (registerPressFromChildren || sentFromChild == null)
{
if (enabled)
{
isPressed = true;
if (OnDown != null) { OnDown(); }
if (OnDownUIItem != null) { OnDownUIItem(this); }
if (SendMessageOnDownMethodName != "" && sendMessageTarget!=null) { sendMessageTarget.SendMessage(SendMessageOnDownMethodName, SendMessageOptions.RequireReceiver); }
}
}
if (parentUIItem != null)
{
parentUIItem.Press(touch, this);
}
}
return true; //newly touched
}
开发者ID:Ahere,项目名称:UnityIsometric,代码行数:36,代码来源:tk2dUIItem.cs
注:本文中的tk2dUIItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论