当前位置:网站首页>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);
}
}
}
边栏推荐
- Compréhension approfondie de l'expérience de port série stm32 (registre) [Tutoriel de niveau nounou]
- Laravel admin obtains non auto increment ID and submits hidden forms
- Seven major trends deeply affecting the U.S. consumer goods industry in 2022
- APICloud 实现文档下载和预览功能
- 我想知道,股票开户有哪些优惠活动?网上开户是否安全么?
- 深圳市福田区支持文化创意产业发展若干措施
- 统计遗传学:第二章,统计分析概念
- VMware虚拟机 桥接模式 无法上网 校园网「建议收藏」
- TCP面试
- Redux related usage
猜你喜欢

HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 2 MPU based IOT device attack mitigation technology

Using the methods in the repository to solve practical problems

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

TCP interview

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

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

2、 MySQL Foundation
![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

This paper introduces the simple operation of realizing linear quadratic moving average of time series prediction that may be used in modeling and excel

APICloud 实现文档下载和预览功能
随机推荐
Please advise tonghuashun which securities firm to choose for opening an account? Is it safe to open a mobile account?
HUST网络攻防实践|6_物联网设备固件安全实验|实验二 基于 MPU 的物联网设备攻击缓解技术
Jsonarray and jsonobject of fastjson [easy to understand]
2016年四川省TI杯电子设计竞赛B题
File decryption in webgame development
UDP protocol details [easy to understand]
ctfshow web入门 命令执行web75-77
. Net, the usage of log components NLog, seriallog, log4net
Basic use of express in nodejs
18:第三章:开发通行证服务:1:短信登录&注册流程,简介;(这儿使用短信验证码)
Seven major trends deeply affecting the U.S. consumer goods industry in 2022
Question B of 2016 Sichuan Ti Cup Electronic Design Competition
Hello! Forward proxy!
The most complete kubernetes core command of the latest version so far
Five problems and solutions of member operation
APICloud 实现文档下载和预览功能
Build document editor based on slate
In depth understanding of STM32 serial port experiment (register) [nanny level tutorial]
证券账户一般需要在哪里开通 开户安全吗
Apiccloud implements the document download and preview functions