当前位置:网站首页>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
边栏推荐
- 如何打开Win10启动文件夹?
- QT actual combat: Yunxi calendar
- 阿里研发三面,面试官一套组合拳让我当场懵逼
- 《JVM系列》 第七章 -- 字节码执行引擎
- OpenFaaS实战之四:模板操作(template)
- Eight way responder system 51 Single Chip Microcomputer Design [with Proteus simulation, C program, schematic diagram, PCB files, component list and papers, etc.]
- 拼接hql时,新增字段没有出现在构造方法中
- ASEMI三相整流桥和单相整流桥的详细对比
- 面试官:说一下类加载的过程以及类加载的机制(双亲委派机制)
- PCIe X1 插槽的主要用途是什么?
猜你喜欢
[untitled]
OC 转 Swift 条件编译、标记、宏、 Log、 版本检测、过期提示
Design of single chip microcomputer Proteus for temperature and humidity monitoring and alarm system of SHT11 sensor (with simulation + paper + program, etc.)
Ali developed three sides, and the interviewer's set of combined punches made me confused on the spot
Do (local scope), initializer, memory conflict, swift pointer, inout, unsafepointer, unsafebitcast, success
Find daffodils - for loop practice
8.3 语言模型与数据集
OpenFaaS实战之四:模板操作(template)
Proteus simulation design of four storey and eight storey elevator control system, 51 single chip microcomputer, with simulation and keil c code
线程同步、生命周期
随机推荐
想要成为架构师?夯实基础最重要
Contraction mapping theorem
Arduino for esp8266串口功能简介
利用 MATLAB 编程实现最速下降法求解无约束最优化问题
GIS数据处理-cesium中模型位置设置
epoll 的EPOLLONESHOT 事件———实例程序
Epolloneshot event of epoll -- instance program
Branch statement of process control
Swift - Literal,字面量协议,基本数据类型、dictionary/array之间的转换
QT Detailed explanation of pro file
do(Local scope)、初始化器、内存冲突、Swift指针、inout、unsafepointer、unsafeBitCast、successor、
OC 转 Swift 条件编译、标记、宏、 Log、 版本检测、过期提示
The initial C language framework is suitable for review and preliminary understanding
剑指 Offer II 019. 最多删除一个字符得到回文(简单)
A blog allows you to learn how to write markdown on vscode
PCIe X1 插槽的主要用途是什么?
ASEMI整流模块MDQ100-16在智能开关电源中的作用
51 MCU + LCD12864 LCD Tetris game, proteus simulation, ad schematic diagram, code, thesis, etc
One of the advanced applications of I / O reuse: non blocking connect -- implemented using select (or poll)
一款不错的工具:aardio