当前位置:网站首页>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);
}
}
}
边栏推荐
- Five strategies and suggestions of member marketing in consumer goods industry
- Laravel admin uses native JS to realize sound prompt and automatic playback
- Change calico network mode to host GW
- 深圳市福田区支持文化创意产业发展若干措施
- APICloud 实现文档下载和预览功能
- 菜鸟实战UML——活动图
- Laravel admin obtains non auto increment ID and submits hidden forms
- 24 database interview questions that must be mastered!
- 4. N queen problem
- NFS共享存储服务安装
猜你喜欢

Omnichannel membership - tmall membership 1: opening tutorial

TCP interview

HUST網絡攻防實踐|6_物聯網設備固件安全實驗|實驗二 基於 MPU 的物聯網設備攻擊緩解技術
![Random numbers in leetcode 710 blacklist [random numbers] the leetcode path of heroding](/img/58/2a56c5c9165295c830082f8b05dd98.png)
Random numbers in leetcode 710 blacklist [random numbers] the leetcode path of heroding
![[graduation season · advanced technology Er] I remember the year after graduation](/img/e7/8e1dafa561217b77a3e3992977a8ec.png)
[graduation season · advanced technology Er] I remember the year after graduation

高并发下如何防重?

Redis的最佳实践?看完不心动,算我输!!

Using the methods in the repository to solve practical problems

Black squares in word

Pre knowledge of hash table -- binary search tree
随机推荐
Seven major trends deeply affecting the U.S. consumer goods industry in 2022
深度学习中的FLOPs和Params如何计算
我想知道,十大劵商如何开户?在线开户安全么?
MQTT断开重连
Omni channel member link - tmall member link 3: preparation of member operation content
Vulnerability scanning and reverse osmosis of Internet anti artifact
利用 Repository 中的方法解决实际问题
Loggie encoding and newline character test
express在nodejs中的基本使用
The most complete kubernetes core command of the latest version so far
Member system + enterprise wechat + applet to help the efficient transformation of private domain
动态规划解决股票问题(下)
What should I do from member labels to portraits?
Cross platform members get through the two channels of brand Ren Du
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure
I want to know whether flush is a stock market? Is it safe to open a mobile account?
One click deployment CEPH script
Jmeter响应时间和tps监听器使用教程
How to calculate flops and params in deep learning
Oracle锁表查询和解锁方法