当前位置:网站首页>CG bone animation
CG bone animation
2022-06-26 12:01:00 【CTGU_ narcissistic_ zh】
CG Skeletal animation
BNUAnimator.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BNUAnimator : MonoBehaviour {
Animator myAnimator;
Transform myCamera;
// Use this for initialization
void Start () {
myAnimator = GetComponent<Animator> ();
myCamera = GameObject.Find ("Main Camera").transform;
}
// Update is called once per frame
void Update () {
myCamera.position = transform.position + new Vector3 (0.0f, 0.6f, -4.0f);
myCamera.LookAt (transform);
if (Input.GetKeyDown (KeyCode.A)) {
myAnimator.SetFloat ("AniFlag", 1);
}
if (Input.GetKeyDown (KeyCode.D)) {
myAnimator.SetFloat ("AniFlag", 2);
}
}
}
BNUControl.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BNUAniControl : MonoBehaviour {
Animator animator;
Animator girlAnimator;
Transform myCamera;
// Use this for initialization
void Start () {
animator = GetComponent<Animator> ();
girlAnimator = GameObject.Find ("Girl").GetComponent<Animator> ();
myCamera = GameObject.Find ("Main Camera").transform;
}
// Update is called once per frame
void Update () {
myCamera.position = transform.position + new Vector3 (-1, 1.5f, -5);
myCamera.LookAt (transform);
KeyControl ();
}
void KeyControl(){
if (Input.GetKeyDown (KeyCode.A)) {
animator.SetBool ("JtoR", true);
girlAnimator.SetBool ("JtoR", true);
animator.SetBool ("RtoJ", false);
girlAnimator.SetBool ("RtoJ", false);
}
if (Input.GetKeyDown (KeyCode.D)) {
animator.SetBool ("RtoJ", true);
girlAnimator.SetBool ("RtoJ", true);
animator.SetBool ("JtoR", false);
girlAnimator.SetBool ("JtoR", false);
}
}
}
BNUControlAdvanced.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BNUAniControl : MonoBehaviour {
Animator animator;
Animator girlAnimator;
Transform myCamera;
// Use this for initialization
void Start () {
animator = GetComponent<Animator> ();
girlAnimator = GameObject.Find ("Girl").GetComponent<Animator> ();
myCamera = GameObject.Find ("Main Camera").transform;
}
// Update is called once per frame
void Update () {
myCamera.position = transform.position + new Vector3 (-1, 1.5f, -5);
myCamera.LookAt (transform);
KeyControl ();
}
void KeyControl(){
if (Input.GetKeyDown (KeyCode.A)) {
animator.SetBool ("JtoR", true);
girlAnimator.SetBool ("JtoR", true);
animator.SetBool ("RtoJ", false);
girlAnimator.SetBool ("RtoJ", false);
}
if (Input.GetKeyDown (KeyCode.D)) {
animator.SetBool ("RtoJ", true);
girlAnimator.SetBool ("RtoJ", true);
animator.SetBool ("JtoR", false);
girlAnimator.SetBool ("JtoR", false);
}
if (Input.GetKeyDown (KeyCode.W)) {
animator.SetBool ("RtoJ", true);
girlAnimator.SetBool ("RtoJ", true);
animator.SetBool ("JtoR", false);
girlAnimator.SetBool ("JtoR", false);
animator.SetBool ("RtoK", true);
girlAnimator.SetBool ("KtoR", false);
}
}
}
边栏推荐
- 女性科学家的流失
- Leetcode 78. 子集 and 90. 子集 II
- Cet article présente la moyenne mobile quadratique linéaire et le fonctionnement simple d'Excel pour réaliser la prédiction des séries chronologiques dans la modélisation.
- Change calico network mode to host GW
- What software is flush? Is online account opening safe?
- CG骨骼动画
- UDP协议详解[通俗易懂]
- File decryption in webgame development
- The best CMDB system
- FasterRCNN
猜你喜欢

Apiccloud implements the document download and preview functions

leetcode 715. Range module (hard)

Matlab programming example: how to count the number of elements in a cell array

.net中,日志组件 Nlog,SerialLog, Log4Net的用法

Using the methods in the repository to solve practical problems
![In depth understanding of STM32 serial port experiment (register) [nanny level tutorial]](/img/b2/f09e220918a85b14a1993aa85f7720.png)
In depth understanding of STM32 serial port experiment (register) [nanny level tutorial]

Statistical genetics: Chapter 2, the concept of statistical analysis

FasterRCNN

AD - 将修改后的 PCB 封装更新到当前 PCB 中
女性科学家的流失
随机推荐
.net中,日志组件 Nlog,SerialLog, Log4Net的用法
请指教同花顺开户选选择哪家券商比较好?手机开户安全么?
Pre knowledge of hash table -- binary search tree
Member system + enterprise wechat + applet to help the efficient transformation of private domain
I want to know whether flush is a stock market? Is it safe to open a mobile account?
Quantitative elementary -- akshare obtains stock code, the simplest strategy
18: Chapter 3: development of pass service: 1: SMS login & registration process, introduction; (SMS verification code is used here)
PolarisMesh系列文章——概念系列(一)
开通证券账户需要注意事项 开户安全吗
Redux related usage
HUST网络攻防实践|6_物联网设备固件安全实验|实验三 FreeRTOS-MPU 保护绕过
TCP interview
十大券商有哪些?手机开户安全么?
FastRCNN
TCP面试
Laravel admin obtains non auto increment ID and submits hidden forms
Apiccloud implements the document download and preview functions
(typora picture bed) Alibaba cloud OSS building picture bed +picgo uploading picture detailed tutorial
我想知道同花顺是炒股的么?手机开户安全么?
2021 q3-q4 investigation report on the use status of kotlin multiplatform