当前位置:网站首页>Project records
Project records
2022-06-11 02:18:00 【Xia 78】
1、 Set lens rotation and limit
void RotateCamera()
{
transform.RotateAround(CenObj.position, Vector3.up, Input.GetAxis("Mouse X") * 5);
transform.RotateAround(CenObj.position, transform.right, -Input.GetAxis("Mouse Y") * 5);
// Affected position and rotation
// Limit the range of the viewing angle moving up and down
float x = transform.eulerAngles.x;
if (x < 0 || x > 85)
{
transform.position = originalPos;
transform.rotation = originalRotation;
}
}
2、Do Tween Multiple rotations occur when the closing lens is pulled closer to the characteristic angle :
The lens z Axis settings 0
3、 Set up UI Occlusion :
if (EventSystem.current.IsPointerOverGameObject()) return;
4、 Get the current time :
System.DateTime.Now
5、text Write read
using UnityEngine;
using System.IO;
public class Error : MonoBehaviour
{
string comduankou;
void Start()
{
comduankou = Application.streamingAssetsPath + "/error.txt";
Write();
Read();
}
/// <summary>
/// Write data
/// </summary>
void Write()
{
StreamWriter textWriter = new StreamWriter(comduankou, true);
string test2 = "\n" + System.DateTime.Now + " write in ";
textWriter.Write(test2);
textWriter.Close();
textWriter.Dispose();
}
/// <summary>
/// Reading data
/// </summary>
void Read()
{
TextReader textReader1 = new StreamReader(comduankou);
string test1 = textReader1.ReadToEnd();
print(test1);
}
}
6、 Set sub object index
int count = parentTransform.childCount;
// The parameter is the order of the object in the current sub object list
//count-1 To point to child The order of objects in the current sub object list is set to the last ,0 For the first time
childTransform.SetSiblingIndex(count - 1);
7、 Set scene sharpness
XRSettings.eyeTextureResolutionScale = 1f;// The standard value is 1
8、Physics.IgnoreCollision Ignore collisions
Physics.IgnoreCollision(Collider A,Collider B)
Ignore Colliders A and B The collision between (start/Update Fine )
9、 Get the current scene name
sceneName = SceneManager.GetActiveScene().name;
10、C# String ------string Of IsNullOrEmpty Method
@ Be careful ,IsNullOrEmpty The judgment object cannot be empty , Not for "". If the object is empty or "“ All back to true.
string.IsNullOrEmpty(null)— return true
string.IsNullOrEmpty(”")— return true
string.IsNullOrEmpty(“sss”)— return false
— Be careful , When judging , return false, It means that the object is neither empty nor "".
边栏推荐
- Is it appropriate for a 27 - year-old girl to change her career from zero to software testing?
- koa2学习笔记
- [penetration test tool bee] how to install and use the XSS penetration test tool bee?
- 接口自动化核心知识点浓缩,为面试加分
- SAP SMARTFORMS换页打印自动判断
- Rewrite: kms activates office2016, 2019 and 2021 with error code: 0xc004f069
- Sequence table exercises
- Analysis of the difficulties in the architecture design of massive chat messages in the live broadcast room
- Find - (sequential search)
- Task01: array
猜你喜欢

贵金属白银行情走势图缘何强势?

Oracle收集统计信息

Secret

Using an old mobile phone to build a server and achieve intranet penetration does not require root (I have personally tested the simplest one many times)

QT database learning notes (II) QT operation SQLite database

Task05: tree

ASEMI场效应管12N65参数,12N65规格书,12N65特征
![[3.delphi common components] 6 scroll bar](/img/55/891e56de4500a9128ac89e3c5b1721.jpg)
[3.delphi common components] 6 scroll bar

Task07: double pointer

SAP smartforms text content manual wrap output
随机推荐
[3.delphi common components] 7 timer
Sword finger offer II 095 Longest common subsequence dynamic programming
Oracle tablespaces, users, and authorization to users
[Qt] Erreur: qapplication: No such file or directory Solution
NFT insider 61:animoca brands holds US $1.5 billion of encrypted assets in 340 investments
Customized redistemplate in redis
[penetration test tool bee] how to install and use the XSS penetration test tool bee?
Find - (block find)
Orcale driver
SSH配置密钥登录时需要注意私钥是否设置了密码(passphrase)
[untitled]
2022 safety officer-b certificate examination question bank and answers
Wrong question (character array)
In the past 10 years, from zero foundation testing to test architect, he has made himself successful
Using an old mobile phone to build a server and achieve intranet penetration does not require root (I have personally tested the simplest one many times)
Introduction for i-Teams
常见漏洞的防御措施整理
Learning C language from scratch day 040
QT database learning notes (II) QT operation SQLite database
SAP smartforms page feed printing automatic judgment