当前位置:网站首页>Unity_ Code mode add binding button click event
Unity_ Code mode add binding button click event
2022-04-23 14:46:00 【The black dog ran forward】
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MainPanel : MonoBehaviour
{
private void Awake()
{
// Code mode binding Click event
transform.Find("BtnTargetList").GetComponent<Button>().onClick.AddListener(OnTargetListButtOnClick);
transform.Find("BtnTargetAdd").GetComponent<Button>().onClick.AddListener(OnTargetAddOnClick);
}
// Click event
private void OnTargetListButtOnClick()
{
UiManager.Instance.TargetListPanel.Show();
}
// Click event
private void OnTargetAddOnClick()
{
Debug.Log(" banana split ");
}
}
版权声明
本文为[The black dog ran forward]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231425301806.html
边栏推荐
- Want to be an architect? Tamping the foundation is the most important
- Do (local scope), initializer, memory conflict, swift pointer, inout, unsafepointer, unsafebitcast, success
- SVN详细使用教程
- Select receives both normal data and out of band data
- LotusDB 设计与实现—1 基本概念
- One of the advanced applications of I / O reuse: non blocking connect -- implemented using select (or poll)
- QT interface optimization: QT border removal and form rounding
- 1 minute to understand the execution process and permanently master the for cycle (with for cycle cases)
- 【STC8G2K64S4】比较器介绍以及比较器掉电检测示例程序
- 2-Go变量操作
猜你喜欢
ArrayList collection basic usage
Proteus simulation design of four storey and eight storey elevator control system, 51 single chip microcomputer, with simulation and keil c code
剑指 Offer II 019. 最多删除一个字符得到回文(简单)
Set up an AI team in the game world and start the super parametric multi-agent "chaos fight"
SVN详细使用教程
ASEMI超快恢复二极管与肖特基二极管可以互换吗
LotusDB 设计与实现—1 基本概念
I thought I could lie down and enter Huawei, but I was confused when I received JD / didi / iqiyi offers one after another
MySQL报错packet out of order
AT89C52 MCU frequency meter (1Hz ~ 20MHz) design, LCD1602 display, including simulation, schematic diagram, PCB and code, etc
随机推荐
How do I open the win10 startup folder?
Mq-2 and DS18B20 fire temperature smoke alarm system design, 51 single chip microcomputer, with simulation, C code, schematic diagram, PCB, etc
First acquaintance with STL
SHT11传感器的温度湿度监控报警系统单片机Proteus设计(附仿真+论文+程序等)
QT interface optimization: double click effect
AT89C51 MCU digital voltmeter development, measuring range 0 ~ 5V, proteus simulation, schematic diagram, PCB and C program, etc
PCIe X1 插槽的主要用途是什么?
[jz46 translate numbers into strings]
Matrix exchange row and column
go基础 反射
Arduino for esp8266串口功能简介
[stc8g2k64s4] introduction of comparator and sample program of comparator power down detection
自动化的艺术
Realization of four data flow modes of grpc based on Multilingual Communication
ASEMI三相整流桥和单相整流桥的详细对比
Sed learning for application
Swift:Entry of program、Swift调用OC、@_silgen_name 、 OC 调用Swift、dynamic、String、Substring
async void 导致程序崩溃
Four ways of SSH restricting login
[detailed explanation of factory mode] factory method mode