当前位置: 首页>>代码示例>>C#>>正文


C# Animator.SetLayerWeight方法代码示例

本文整理汇总了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);


	}
开发者ID:tylerjhutchison,项目名称:RitualVillage,代码行数:10,代码来源:VillagerAnimation.cs

示例2: Start

 void Start()
 {
     anim = GetComponent<Animator>();
     if (anim.layerCount == 3)
     {
         anim.SetLayerWeight(1, 1);
         anim.SetLayerWeight(2, 1);
     }
     tick = 0;
 }
开发者ID:CG-F15-32-Rutgers,项目名称:UnityProjects,代码行数:10,代码来源:KyleControlScript.cs

示例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;
    }
开发者ID:BluZombie,项目名称:MyProjects,代码行数:12,代码来源:EnemyAnimation.cs

示例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);
    }
开发者ID:kabuki0111,项目名称:HideAndSeekGame,代码行数:13,代码来源:EnemyController.cs

示例5: Awake

 void Awake()
 {
     playerRigidbody = GetComponent<Rigidbody>();
     anim = GetComponent<Animator>();
     if (anim.layerCount == 2)
         anim.SetLayerWeight(1, 1);
 }
开发者ID:zahmm83,项目名称:LundumDare2015,代码行数:7,代码来源:CharacterMovement.cs

示例6: Start

 void Start()
 {
     controller = GetComponent<CharacterController>();
     animator = GetComponent<Animator>();
     if(animator.layerCount >= 2)
         animator.SetLayerWeight(1, 1);
 }
开发者ID:solsticehc,项目名称:citadel,代码行数:7,代码来源:BasicController03.cs

示例7: Start

 void Start()
 {
     // initialising reference variables
     anim = GetComponent<Animator>();
     if(anim.layerCount ==2)
         anim.SetLayerWeight(1, 1);
 }
开发者ID:Manwelanza,项目名称:VuforiaRA,代码行数:7,代码来源:BotControlScript.cs

示例8: Start

    void Start()
    {
        playerPhysics = GetComponent<PlayerPhysics>();
        animator = GetComponent<Animator>();

        animator.SetLayerWeight(1, 1);
    }
开发者ID:TinGirlProject,项目名称:TGP,代码行数:7,代码来源:PlayerController.cs

示例9: Start

 /// <summary>
 /// Inicia o jogador
 /// </summary>
 void Start()
 {
    playerPhysics = GetComponent<PlayerPhysics>();
    animator = GetComponent<Animator>();
    manager = Camera.main.GetComponent<GameManager>();
    animator.SetLayerWeight(0, 0);
 }
开发者ID:Kokline,项目名称:ProjetoIntegradorD,代码行数:10,代码来源:PlayerController.cs

示例10: Awake

    private void Awake()
    {
        anim = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameConstroller).GetComponent<HashIDs>();

        anim.SetLayerWeight(1, 1f);
    }
开发者ID:HitomiFlower,项目名称:Stealth-VR,代码行数:7,代码来源:PlayerMovement.cs

示例11: Start

    // Use this for initialization
    void Start()
    {
        animator = GetComponent<Animator>();

        if(animator.layerCount >= 2)
            animator.SetLayerWeight(1, 1);
    }
开发者ID:svaldivia,项目名称:Van-Game-Jam,代码行数:8,代码来源:InputControl.cs

示例12: Awake

    void Awake()
    {
        // Setting up the references.
        anim = GetComponent<Animator>();

        // Set the weight of the shouting layer to 1.
        anim.SetLayerWeight(1, 1f);
    }
开发者ID:blackbook2016,项目名称:UnityRepository_2,代码行数:8,代码来源:DonePlayerMovement.cs

示例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);
 }
开发者ID:JelleDekkers,项目名称:AfstudeerProject,代码行数:8,代码来源:HumanoidAnimatorHandler.cs

示例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
    }
开发者ID:rnabeth,项目名称:stealth,代码行数:17,代码来源:EnemyAnimation.cs

示例15: Start

 void Start()
 {
     animator = GetComponent<Animator>();
     motor = GetComponent<EnemyMotor>();
     logic = GetComponent<EnemyLogic>();
     animator.SetBool("Jumping",false);
     animator.SetLayerWeight(1,1);
 }
开发者ID:jlonardi,项目名称:igp-DnM,代码行数:8,代码来源:EnemyAnimator.cs


注:本文中的UnityEngine.Animator.SetLayerWeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。