当前位置:网站首页>Unity sends messages and blocks indecent words
Unity sends messages and blocks indecent words
2022-07-05 04:55:00 【yaohuiyaoo】
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Test : MonoBehaviour {
Text text;
Button btn;
InputField inout;
string temp;
void Start () {
temp = null;
text = transform.GetChild(0).GetComponent
btn = transform.GetChild(1).GetComponent();
inout = transform.GetChild(2).GetComponent();
btn.onClick.AddListener(Send);
}
string mm;
void Send()
{
string s =inout.text;
List list = new List();
list.Add(“ Bad guys ”);
list.Add(“ A fool ”);
for(int i = 0; i < list.Count; i++)
{
for (int j = 0; j< s.Length; j++)
{
temp = temp + s[j];
//print(temp);
for (int z =j+1; z < s.Length; z++)
{
temp = temp+s[z];
print(temp);
if (temp.Equals(list[i]))
{
int y = z - j;
mm= s.Replace(temp,Change(y));
break;
}
}
temp = null;
}
}
text.text = mm;
}
private string Change(int y)
{
string s = null;
for (int i = 0; i <=y; i++)
{
s = s + "*";
}
return s;
}
边栏推荐
- Emlog blog theme template source code simple good-looking responsive
- [groovy] closure (closure call is associated with call method | call () method is defined in interface | call () method is defined in class | code example)
- Common technologies of unity
- Unity connects to the database
- #775 Div.1 C. Tyler and Strings 组合数学
- 2021 electrician cup (the 12th "China Society of electrical engineering Cup" National Undergraduate electrician mathematical modeling) detailed ideas + codes + references
- Research and forecast report on China's solution polymerized styrene butadiene rubber (SSBR) industry (2022 Edition)
- Interface joint commissioning test script optimization V5.0 (end)
- PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低
- C4D simple cloth (version above R21)
猜你喜欢
2022 U.S. college students' mathematical modeling e problem ideas / 2022 U.S. game e problem analysis
2021-10-29
Number theoretic function and its summation to be updated
[goweb development] Introduction to authentication modes based on cookies, sessions and JWT tokens
Rip notes [rip message security authentication, increase of rip interface measurement]
【Leetcode】1352. Product of the last K numbers
[groovy] closure (Introduction to closure class closure | this, owner, delegate member assignment and source code analysis)
AutoCAD - scaling
Autocad-- dynamic zoom
Thematic information | carbon, carbon neutrality, low carbon, carbon emissions - 22.1.9
随机推荐
"Measuring curve length" of CAD dream drawing
计组笔记(1)——校验码、原补码乘除计算、浮点数计算
mysql审计日志归档
2021 huashubei mathematical modeling idea + reference + paper
This article is good
Fluent objects and lists
Solutions and answers for the 2021 Shenzhen cup
Thematic information | carbon, carbon neutrality, low carbon, carbon emissions - 22.1.9
How much do you know about 3DMAX rendering skills and HDRI light sources? Dry goods sharing
[crampon game] MC tutorial - first day of survival
775 Div.1 C. Tyler and strings combinatorial mathematics
Introduce Hamming distance and calculation examples
PR first time
Interface joint commissioning test script optimization V5.0 (end)
AutoCAD - command repetition, undo and redo
Personal required code
669. 修剪二叉搜索树 ●●
AutoCAD - workspace settings
用 Jmeter 工具做个小型压力测试
AutoCAD - stretching