本文整理汇总了C#中UnityEngine.Animator.SetLayerWeight方法的典型用法代码示例。如果您正苦于以下问题:C# Animator.SetLayerWeight方法的具体用法?C# Animator.SetLayerWeight怎么用?C# Animator.SetLayerWeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Animator
的用法示例。
在下文中一共展示了Animator.SetLayerWeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init(string letter) {
anim = GetComponent<Animator>();
//this is getting called before start for
char asciiLetter = letter.ToCharArray ()[0];
int stateLayerIndex = System.Convert.ToInt32 (asciiLetter) - 97;
anim.SetLayerWeight(0,1f);
anim.SetLayerWeight(stateLayerIndex +1,1f);
}
示例2: Start
void Start()
{
anim = GetComponent<Animator>();
if (anim.layerCount == 3)
{
anim.SetLayerWeight(1, 1);
anim.SetLayerWeight(2, 1);
}
tick = 0;
}
示例3: Awake
void Awake()
{
nav = GetComponent<NavMeshAgent>();
anim = GetComponent<Animator>();
hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();
nav.updateRotation = false;
animSetup = new AnimatorSetup(anim, hash);
anim.SetLayerWeight(1, 1f);
anim.SetLayerWeight(2, 1f);
deadZone *= Mathf.Deg2Rad;
}
示例4: Awake
void Awake()
{
animtor = GetComponent<Animator>();
navAgent = GetComponent<NavMeshAgent>();
opticSphereCol = GetComponent<SphereCollider>();
playerGameObject = GameObject.FindGameObjectWithTag(DoneTags.player);
animatorController = GameObject.Find(PathHelper.gameManagerPath).GetComponent<EnemyAnimatorController>();
gameManager = GameObject.Find(PathHelper.gameManagerPath).GetComponent<GameManager>();
enemyStatus = gameObject.transform.FindChild(GameObjectNameHelper.robotGuardName).GetComponent<EnemyStatus>();
animtor.SetLayerWeight(1, 1f);
animtor.SetLayerWeight(2, 1f);
}
示例5: Awake
void Awake()
{
playerRigidbody = GetComponent<Rigidbody>();
anim = GetComponent<Animator>();
if (anim.layerCount == 2)
anim.SetLayerWeight(1, 1);
}
示例6: Start
void Start()
{
controller = GetComponent<CharacterController>();
animator = GetComponent<Animator>();
if(animator.layerCount >= 2)
animator.SetLayerWeight(1, 1);
}
示例7: Start
void Start()
{
// initialising reference variables
anim = GetComponent<Animator>();
if(anim.layerCount ==2)
anim.SetLayerWeight(1, 1);
}
示例8: Start
void Start()
{
playerPhysics = GetComponent<PlayerPhysics>();
animator = GetComponent<Animator>();
animator.SetLayerWeight(1, 1);
}
示例9: Start
/// <summary>
/// Inicia o jogador
/// </summary>
void Start()
{
playerPhysics = GetComponent<PlayerPhysics>();
animator = GetComponent<Animator>();
manager = Camera.main.GetComponent<GameManager>();
animator.SetLayerWeight(0, 0);
}
示例10: Awake
private void Awake()
{
anim = GetComponent<Animator>();
hash = GameObject.FindGameObjectWithTag(Tags.gameConstroller).GetComponent<HashIDs>();
anim.SetLayerWeight(1, 1f);
}
示例11: Start
// Use this for initialization
void Start()
{
animator = GetComponent<Animator>();
if(animator.layerCount >= 2)
animator.SetLayerWeight(1, 1);
}
示例12: Awake
void Awake()
{
// Setting up the references.
anim = GetComponent<Animator>();
// Set the weight of the shouting layer to 1.
anim.SetLayerWeight(1, 1f);
}
示例13: Start
protected virtual void Start() {
anim = GetComponent<Animator>();
actor = GetComponent<Actor>();
col = GetComponent<CapsuleCollider>();
colHeightOrigin = col.height;
colCenterOrigin = col.center;
anim.SetLayerWeight(upperBodyLayerIndex, 1);
}
示例14: Awake
void Awake()
{
player = GameObject.FindGameObjectWithTag(Tags.player).transform;
enemySight = GetComponent<EnemySight>();
nav = GetComponent<NavMeshAgent>();
anim = GetComponent<Animator>();
hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();
nav.updateRotation = false; //To make sure that the rotation of the enemy is set by the animator and not by the nav mesh agent - To reduce foot slipping whilst turning corners
animSetup = new AnimatorSetup(anim, hash);
anim.SetLayerWeight(1, 1f); //Shooting Layer
anim.SetLayerWeight(2, 1f); //Gun Layer
deadZone *= Mathf.Deg2Rad; //Convert from degrees to radians
}
示例15: Start
void Start()
{
animator = GetComponent<Animator>();
motor = GetComponent<EnemyMotor>();
logic = GetComponent<EnemyLogic>();
animator.SetBool("Jumping",false);
animator.SetLayerWeight(1,1);
}