当前位置:网站首页>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;
}
}
}
边栏推荐
- Solutions and answers for the 2021 Shenzhen cup
- Cocos progress bar progresstimer
- 2022 American College Students' mathematical modeling ABCDEF problem thinking /2022 American match ABCDEF problem analysis
- UE4/UE5 虚幻引擎,材质篇,纹理,Compression and Memory压缩和内存
- China needle coke industry development research and investment value report (2022 Edition)
- 54. 螺旋矩阵 & 59. 螺旋矩阵 II ●●
- AutoCAD - Document Management
- "Measuring curve length" of CAD dream drawing
- 2020-10-27
- 775 Div.1 C. Tyler and strings combinatorial mathematics
猜你喜欢

PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低

2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem

Group counting notes (1) - check code, original complement multiplication and division calculation, floating point calculation

669. 修剪二叉搜索树 ●●

C4D simple cloth (version above R21)

2021 huashubei mathematical modeling idea + reference + paper
![[groovy] closure (closure parameter binding | curry function | rcurry function | ncurry function | code example)](/img/90/0cf08ae6fea61891e3e1fdf29d310c.jpg)
[groovy] closure (closure parameter binding | curry function | rcurry function | ncurry function | code example)

2021-10-29

Introduce Hamming distance and calculation examples

669. Prune binary search tree ●●
随机推荐
"Measuring curve length" of CAD dream drawing
Special information | finance, accounting, audit - 22.1.23
Unity and database
[groovy] closure (closure parameter list rule | default parameter list | do not receive parameters | receive custom parameters)
Thinking of 2022 American College Students' mathematical modeling competition
xss注入
2021 electrician cup idea + code - photovoltaic building integration plate index development trend analysis and prediction: prediction planning issues
#775 Div.1 B. Integral Array 数学
775 Div.1 B. integral array mathematics
[groovy] closure (closure call | closure default parameter it | code example)
Rip notes [rip message security authentication, increase of rip interface measurement]
C4D simple cloth (version above R21)
[ideas] 2021 may day mathematical modeling competition / May Day mathematical modeling ideas + references + codes
C # perspective following
Common database statements in unity
AutoCAD - continuous annotation
UE4/UE5 虚幻引擎,材质篇,纹理,Compression and Memory压缩和内存
AutoCAD - set layer
Group counting notes (1) - check code, original complement multiplication and division calculation, floating point calculation
Séparation et combinaison de la construction du système qualité