当前位置:网站首页>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);
}
}
}
边栏推荐
- Ctrip ticket app KMM cross end kV repository mmkv kotlin | open source
- Refined operation, extending the full life cycle value LTV
- leetcode 715. Range module (hard)
- flannel的host-gw与calico
- 关于印发《深圳市福田区支持战略性新兴产业和未来产业集群发展若干措施》的通知
- Introduction to Dolby panoramic sound
- The best CMDB system
- CG骨骼动画
- 4. N queen problem
- Cross platform members get through the two channels of brand Ren Du
猜你喜欢

Ctfshow web getting started command execution web75-77

18:第三章:开发通行证服务:1:短信登录&注册流程,简介;(这儿使用短信验证码)

Jmeter响应时间和tps监听器使用教程

18: Chapter 3: development of pass service: 1: SMS login & registration process, introduction; (SMS verification code is used here)

4. N queen problem

【毕业季·进击的技术er】忆毕业一年有感

Machine Learning Clustering - Experimental Report

AD - 将修改后的 PCB 封装更新到当前 PCB 中

利用 Repository 中的方法解决实际问题

Deep thinking from senior member managers
随机推荐
Lintcode 130 · 堆化
NFS共享存储服务安装
Polarismesh series articles - concept series (I)
深度学习中的FLOPs和Params如何计算
PolarisMesh系列文章——概念系列(一)
How to do well in member marketing three steps to teach you to understand member management
Re recognized! Know that Chuangyu has been selected as one of the first member units of the "business security promotion plan"
UDP protocol details [easy to understand]
AD - 将修改后的 PCB 封装更新到当前 PCB 中
Please advise tonghuashun which securities firm to choose for opening an account? Is it safe to open a mobile account?
初探Protostuff的使用[通俗易懂]
Redux related usage
Excel operation of manual moving average method and exponential smoothing method for time series prediction
我想知道同花顺是炒股的么?在线开户安全么?
Loggie encoding and newline character test
Basic use of express in nodejs
HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 3 freertos-mpu protection bypass
What should I do from member labels to portraits?
webgame开发中的文件解密
HUST网络攻防实践|6_物联网设备固件安全实验|实验三 FreeRTOS-MPU 保护绕过