当前位置:网站首页>unity 功能扩展
unity 功能扩展
2022-04-23 20:45:00 【夏炎黄】
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public static class ExtensionMethod
{
public static TaskAwaiter GetAwaiter(this AsyncOperation asyncOperation)
{
var tcs = new TaskCompletionSource<object>();
asyncOperation.completed += obj => { tcs.SetResult(null); };
return ((Task)tcs.Task).GetAwaiter();
}
public static TextMeshProUGUI GetPlaceholder(this TMP_InputField tMP_InputField)
{
return tMP_InputField.placeholder.GetComponent<TextMeshProUGUI>();
}
public static TextMeshProUGUI Lable(this Toggle toggle)
{
TextMeshProUGUI textMeshProUGUI = toggle.transform.Find("Label").GetComponent<TextMeshProUGUI>();
return textMeshProUGUI;
}
public static Transform ToggleContent(this Toggle toggle)
{
return toggle.transform.Find("Content");
}
public static TextMeshProUGUI Placeholder(this TMP_InputField tMP_InputField)
{
return tMP_InputField.placeholder.GetComponent<TextMeshProUGUI>();
}
}
版权声明
本文为[夏炎黄]所创,转载请带上原文链接,感谢
https://blog.csdn.net/XYH_78/article/details/124321085
边栏推荐
- An error occurs when the addressable assets system project is packaged. Runtimedata is null
- The iswow64process function determines the number of program bits
- Syntaxerror: unexpected token r in JSON at position 0
- Awk print special characters
- The construction and use of Fortress machine and springboard machine jumpserver are detailed in pictures and texts
- 黑客的入侵方式你知道几种?
- Three. Based on ply format point cloud voxel model JS upload interface writing
- Leetcode 1337. Row K with the weakest combat effectiveness in the matrix
- Zhongchuang storage | how to choose a useful distributed storage cloud disk
- UKFslam
猜你喜欢

电脑越用越慢怎么办?文件误删除恢复方法

Preliminary understanding of cache elimination algorithm (LRU and LFU)

Solution: NPM err! code ELIFECYCLE npm ERR! errno 1

LeetCode 74、搜索二维矩阵

JS arrow function user and processing method of converting arrow function into ordinary function

Unity animation creates sequence frame code and generates animationclip

Imitation Baidu map realizes the three buttons to switch the map mode by automatically shrinking the bottom
![[stack and queue topics] - sliding window](/img/65/a2ce87f1401d7a28d4cce0cc85175f.png)
[stack and queue topics] - sliding window

On IRP from the perspective of source code

vulnhub DC:1渗透笔记
随机推荐
Unity solves Z-fighting
Bash script learning -- for loop traversal
Singleton mode
Preliminary understanding of cache elimination algorithm (LRU and LFU)
Communication between RING3 and ring0
Parsing methods of JSON data in C - jar and jobobject: error reading jar from jsonreader Current JsonReader item
High paid programmer & interview question series 91 limit 20000 loading is very slow. How to solve it? How to locate slow SQL?
Recognition of high-speed road signs by Matlab using alexnet
Introduction to intrusion detection data set
Install MySQL 5.0 under Linux 64bit 6 - the root password cannot be modified
C# 知识
MySQL进阶之数据的增删改查(DML)
Recommended usage scenarios and production tools for common 60 types of charts
The more you use the computer, the slower it will be? Recovery method of file accidental deletion
CONDA environment management command
LeetCode 232、用栈实现队列
SQL: query duplicate data and delete duplicate data
6-5 string - 2 String copy (assignment) (10 points) the C language standard function library includes the strcpy function for string copy (assignment). As an exercise, we write a function with the sam
居家第二十三天的午饭
On the three paradigms of database design