当前位置:网站首页>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
边栏推荐
- Electronic perpetual calendar of DS1302_ 51 single chip microcomputer, month, day, week, hour, minute and second, lunar calendar and temperature, with alarm clock and complete set of data
- 如何打开Win10启动文件夹?
- 成都控制板设计提供_算是详细了_单片机程序头文件的定义、编写及引用介绍
- Electronic scale weighing system design, hx711 pressure sensor, 51 single chip microcomputer (proteus simulation, C program, schematic diagram, thesis and other complete data)
- Usage of BC
- 金九银十,入职字节跳动那一天,我哭了(蘑菇街被裁,奋战7个月拿下offer)
- 8.5 循环神经网络简洁实现
- 2-GO variable operation
- Detailed explanation of C language P2 selection branch statement
- 《JVM系列》 第七章 -- 字节码执行引擎
猜你喜欢
L'externalisation a duré quatre ans.
直流可调稳压电源的Proteus仿真设计(附仿真+论文等资料)
【JZ46 把数字翻译成字符串】
[detailed explanation of factory mode] factory method mode
capacitance
LotusDB 设计与实现—1 基本概念
GIS数据处理-cesium中模型位置设置
[untitled]
Detailed explanation of C language knowledge points -- first knowledge of C language [1]
【Servlet】Servlet 详解(使用+原理)
随机推荐
Detailed explanation of C language P2 selection branch statement
Design of single chip microcomputer Proteus for temperature and humidity monitoring and alarm system of SHT11 sensor (with simulation + paper + program, etc.)
Advanced application of I / O multiplexing: Processing TCP and UDP services at the same time
ArrayList collection basic usage
The art of automation
Go basic reflection
【无标题】
8.4 循环神经网络从零实现
Thread synchronization, life cycle
Outsourcing for four years, abandoned
拼接hql时,新增字段没有出现在构造方法中
pnpm安装使用
MySQL报错packet out of order
2-Go变量操作
Matrix exchange row and column
成都控制板设计提供_算是详细了_单片机程序头文件的定义、编写及引用介绍
你还不知道责任链模式的使用场景吗?
Interviewer: let's talk about the process of class loading and the mechanism of class loading (parental delegation mechanism)
Epolloneshot event of epoll -- instance program
Epoll's et, lt working mode -- example program