当前位置:网站首页>Unity card flipping effect
Unity card flipping effect
2022-07-05 04:56:00 【Meteor spot】
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class fanzhuan : MonoBehaviour
{
private Quaternion T;
private Quaternion V;
public GameObject A;// positive
public GameObject B;// Back //
// public GameObject C;
private bool bol = true;
void Start()
{
B.transform.rotation = Quaternion.Euler(0, 90, 0);
}
public void Init()
{
A.transform.rotation = Quaternion.Euler(0, 0, 0);
B.transform.rotation = Quaternion.Euler(0, 90, 0);
}
void Update()
{
// The following two lines are for him to rotate around himself //
// A.transform.Rotate(new Vector3(0, 90 * Time.deltaTime * 2.5f, 0));
//
//A.transform.Rotate(Vector3.down,3);
}
public void BtnClick()
{
if (bol)
{
// Init();
InvokeRepeating("BE", 0, 0.02f);
CancelInvoke("BD");
}
else
{
//Init();
InvokeRepeating("BD", 0.5f, 0.02f);
CancelInvoke("BE");
}
}
private void BE()
{
// C.transform.GetComponent<Button>().enabled = false;
T = Quaternion.Euler(0, 90, 0);
V = Quaternion.Euler(0, 0, 0);
A.transform.rotation = Quaternion.RotateTowards(A.transform.rotation, T,6f);
if (A.transform.eulerAngles.y > 89 && A.transform.eulerAngles.y < 91)
{
B.transform.rotation = Quaternion.RotateTowards(B.transform.rotation, V,6f);
bol = false;
// C.transform.GetComponent<Button>().enabled = true;
}
}
private void BD()
{
// Return action
// C.transform.GetComponent<Button>().enabled = false;
T = Quaternion.Euler(0, 90, 0);
V = Quaternion.Euler(0, 0, 0);
B.transform.rotation = Quaternion.RotateTowards(B.transform.rotation, T, 6f);
if (B.transform.eulerAngles.y > 89 && B.transform.eulerAngles.y < 91)
{
// Add this judgment because it is written 90 degree , But it can't be directly 90 Degree integer , So I added such a judgment
A.transform.rotation = Quaternion.RotateTowards(A.transform.rotation, V, 6f);
bol = true;
//C.transform.GetComponent<Button>().enabled = true;
}
}
}
边栏推荐
- Unity sends messages and blocks indecent words
- Out and ref functions of unity
- Download the details and sequence of the original data access from the ENA database in EBI
- Unity check whether the two objects have obstacles by ray
- Autocad-- Real Time zoom
- [LeetCode] 整数反转【7】
- 669. 修剪二叉搜索树 ●●
- PostgreSQL surpasses mysql, and the salary of "the best programming language in the world" is low
- #775 Div.1 C. Tyler and Strings 组合数学
- Unity shot tracking object
猜你喜欢

Detailed introduction of OSPF header message

AutoCAD - full screen display
![[Business Research Report] Research Report on male consumption trends in other economic times -- with download link](/img/08/7ea490c46c3f64af3e78d07b19b3e3.jpg)
[Business Research Report] Research Report on male consumption trends in other economic times -- with download link
![[groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)](/img/1b/1fa2ebc9a6c5d271c9b39f5e508fb0.jpg)
[groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)

Number theoretic function and its summation to be updated
![[groovy] closure (Introduction to closure class closure | this, owner, delegate member assignment and source code analysis)](/img/aa/3c8b7b27e322417777d1315b9a5a8f.jpg)
[groovy] closure (Introduction to closure class closure | this, owner, delegate member assignment and source code analysis)

3dsmax scanning function point connection drawing connection line

"Measuring curve length" of CAD dream drawing

Looking at Chinese science and technology from the Winter Olympics: what is the mystery of the high-speed camera that the whole people thank?

AutoCAD - command repetition, undo and redo
随机推荐
Basic knowledge points
mysql審計日志歸檔
MySQL audit log Archive
Common technologies of unity
django连接数据库报错,这是什么原因
Redis 排查大 key 的4种方法,优化必备
54. Spiral matrix & 59 Spiral matrix II ●●
Forecast report on research and investment prospects of Chinese wormwood industry (2022 Edition)
中国金刚烷行业研究与投资预测报告(2022版)
Unity3d learning notes
Minor spanning tree
Judge the position of the monster in the role under unity3d
Sqlserver stored procedures pass array parameters
Thematic information | carbon, carbon neutrality, low carbon, carbon emissions - 22.1.9
Is $20billion a little less? Cisco is interested in Splunk?
Unity synergy
Flutter tips: various fancy nesting of listview and pageview
#775 Div.1 B. Integral Array 数学
AutoCAD - Document Management
MySQL audit log archiving