当前位置:网站首页>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 "".
边栏推荐
- CRS-5017
- [traffic sign recognition] Based on Matlab GUI YCbCr feature extraction +bp neural network traffic sign recognition [including Matlab source code 1869]
- 2022 safety officer-b certificate examination question bank and answers
- 为什么有的程序员能力一般却能拿到好offer?
- 记录一下我的刷题实录
- The female programmer gives out a salary slip: the salary is high, but she feels she is 10 years old
- 889. 根据前序和后序遍历构造二叉树
- Introduction and practice of QT tcp/udp network protocol (supplementary)
- Task02: linked list
- Me11/me12 purchase information record and condition record creation and update bapi:me_ INFORECORD_ MAINTAIN_ MULTI
猜你喜欢

Introduction and practice of QT tcp/udp network protocol (II) UDP communication

双面材质【double sided】的Shader

ABAP CDS实现多行字段内容拼接

CRS-5017

In the past 10 years, from zero foundation testing to test architect, he has made himself successful

NFT Insider #61:Animoca Brands 在 340 项投资中持有 15 亿美元的加密资产

软件测试面试复盘:技术面没有难倒我,hr面却是一把挂

ABAP CDs realizes multi line field content splicing
![[traffic sign recognition] Based on Matlab GUI YCbCr feature extraction +bp neural network traffic sign recognition [including Matlab source code 1869]](/img/66/3f7134298e7e9a7fbf9b0c99dafb2a.jpg)
[traffic sign recognition] Based on Matlab GUI YCbCr feature extraction +bp neural network traffic sign recognition [including Matlab source code 1869]

The interviewer of Tencent said that who knows the internal module index principle and performance optimization idea of MySQL architecture?
随机推荐
Fb02 edit coding block field
ABAP CDs realizes multi line field content splicing
[3.delphi common components] 5 List class component
【无标题】
Virtual joystick of QT quick QML instance
Return function of different return values
3P5 Industrial Engineering Lecture 1-2: Method of Study
CRS-5017
[Qt] Erreur: qapplication: No such file or directory Solution
The female programmer gives out a salary slip: the salary is high, but she feels she is 10 years old
Question g: candy
Task05: tree
Task06: bit operation
Day code 300 lines learning notes day 22
889. 根据前序和后序遍历构造二叉树
Asemi FET 12n65 parameters, 12n65 specifications, 12n65 features
During SSH configuration key login, you need to pay attention to whether the private key is set with a password
[music] playing "over fire" based on MATLAB [including Matlab source code 1875]
Infinite level classification (or menu) design
Jump without refresh - detailed explanation of pushstate and replacestate methods in history