SetLayerWeight() public method

public SetLayerWeight ( int layerIndex, float weight ) : void
layerIndex int
weight float
return void
コード例 #1
1
	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
0
 void Start()
 {
     anim = GetComponent<Animator>();
     if (anim.layerCount == 3)
     {
         anim.SetLayerWeight(1, 1);
         anim.SetLayerWeight(2, 1);
     }
     tick = 0;
 }
コード例 #3
0
    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
0
    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
0
 void Awake()
 {
     playerRigidbody = GetComponent<Rigidbody>();
     anim = GetComponent<Animator>();
     if (anim.layerCount == 2)
         anim.SetLayerWeight(1, 1);
 }
コード例 #6
0
 void Start()
 {
     controller = GetComponent<CharacterController>();
     animator = GetComponent<Animator>();
     if(animator.layerCount >= 2)
         animator.SetLayerWeight(1, 1);
 }
コード例 #7
0
 void Start()
 {
     // initialising reference variables
     anim = GetComponent<Animator>();
     if(anim.layerCount ==2)
         anim.SetLayerWeight(1, 1);
 }
コード例 #8
0
    void Start()
    {
        playerPhysics = GetComponent<PlayerPhysics>();
        animator = GetComponent<Animator>();

        animator.SetLayerWeight(1, 1);
    }
コード例 #9
0
    private void Awake()
    {
        anim = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameConstroller).GetComponent<HashIDs>();

        anim.SetLayerWeight(1, 1f);
    }
コード例 #10
0
    // Use this for initialization
    void Start()
    {
        animator = GetComponent<Animator>();

        if(animator.layerCount >= 2)
            animator.SetLayerWeight(1, 1);
    }
コード例 #11
0
 /// <summary>
 /// Inicia o jogador
 /// </summary>
 void Start()
 {
    playerPhysics = GetComponent<PlayerPhysics>();
    animator = GetComponent<Animator>();
    manager = Camera.main.GetComponent<GameManager>();
    animator.SetLayerWeight(0, 0);
 }
コード例 #12
0
    void Awake()
    {
        // Setting up the references.
        anim = GetComponent<Animator>();

        // Set the weight of the shouting layer to 1.
        anim.SetLayerWeight(1, 1f);
    }
コード例 #13
0
 protected virtual void Start() {
     anim = GetComponent<Animator>();
     actor = GetComponent<Actor>();
     col = GetComponent<CapsuleCollider>();
     colHeightOrigin = col.height;
     colCenterOrigin = col.center;
     anim.SetLayerWeight(upperBodyLayerIndex, 1);
 }
コード例 #14
0
ファイル: PlayerMovement.cs プロジェクト: rnabeth/stealth
 void Awake()
 {
     rigidbody = GetComponent<Rigidbody> ();
     audio = GetComponent<AudioSource> ();
     anim = GetComponent<Animator> ();
     hash = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<HashIDs> ();
     anim.SetLayerWeight (1, 1f);
 }
コード例 #15
0
	// Use this for initialization
	void Start () {
		animator = GetComponent<Animator> ();

		if (animator.layerCount > 1) {
			int index = animator.GetLayerIndex("ArmLayer");
			animator.SetLayerWeight(index,1.0f);
		}
	}
コード例 #16
0
    void Awake()
    {
        anim = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIds>();
        targetDirection = new Vector3();

        anim.SetLayerWeight(1, 0.8f);
    }
コード例 #17
0
ファイル: EnemyAnimator.cs プロジェクト: jlonardi/igp-DnM
 void Start()
 {
     animator = GetComponent<Animator>();
     motor = GetComponent<EnemyMotor>();
     logic = GetComponent<EnemyLogic>();
     animator.SetBool("Jumping",false);
     animator.SetLayerWeight(1,1);
 }
コード例 #18
0
ファイル: ShoujoController.cs プロジェクト: Fawel/Mahou
	void Start(){
		m_Cam = Camera.main.transform;
		animator = GetComponent<Animator>();
		m_Rigidbody = GetComponent<Rigidbody>();
		if (animator.layerCount >= 2) {
			animator.SetLayerWeight(1, 1);
		}
	}
コード例 #19
0
 void Start()
 {
     animator = GetComponent<Animator>();
      if (animator.layerCount >= 2){
        animator.SetLayerWeight(1,1);
        m_LocomotionId = Animator.StringToHash("Base Layer.Locomotion");
      }
 }
コード例 #20
0
	void Start ()
	{
		// initialising reference variables
		anim = gameObject.GetComponent<Animator>();					  
		col = gameObject.GetComponent<CapsuleCollider>();				
		if(anim.layerCount ==2)
			anim.SetLayerWeight(1, 1);
	}
コード例 #21
0
ファイル: EnemyAnimation.cs プロジェクト: rnabeth/stealth
    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
    }
コード例 #22
0
ファイル: IdleRunJump.cs プロジェクト: Ralph89/SoccerRally
    // Use this for initialization
    void Start () 
    {
        animator = GetComponent<Animator>();
        m_PhotonView = GetComponent<PhotonView>();
        m_TransformView = GetComponent<PhotonTransformView>();

        if(animator.layerCount >= 2)
            animator.SetLayerWeight(1, 1);
    }
コード例 #23
0
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (firstSetting)
     {
         this.shootingLayer = animator.GetLayerIndex("Shoot");
         this.firstSetting = false;
     }
     animator.SetLayerWeight(shootingLayer, 0.4f);
 }
コード例 #24
0
ファイル: NavControl.cs プロジェクト: Tharensis/cecs528
	// Use this for initialization
	void Start () 
	{
		animator = GetComponent<Animator>(); // assign the Animator component

		if(animator && animator.layerCount > 1)
			animator.SetLayerWeight(1,1.0f); // set layer 1's weight to 1

		rb = GetComponent<Rigidbody> ();
	}
コード例 #25
0
ファイル: CRAttackBehaviour.cs プロジェクト: silantzis/quest
    void Awake()
    {
        _animator = GetComponentInChildren<Animator>();
        _agent = GetComponentInChildren<Agent>();
        _controller = GetComponent<CRController>();

        if(_animator && _animator.layerCount >= 2)
            _animator.SetLayerWeight(1, 1);
    }
コード例 #26
0
ファイル: movement.cs プロジェクト: hanwang92/Shining
    // Use this for initialization
    void Start()
    {
        animator = GetComponent<Animator>();

        TextColor =  start.GetComponent<Renderer> ().material.color;

        if(animator.layerCount >= 2)
            animator.SetLayerWeight(1, 1);
    }
コード例 #27
0
ファイル: PlayerMovement.cs プロジェクト: mtejedorg/Unity
    void Awake()
    {
        // Setting up the references.
        anim = GetComponent<Animator>();
        hash = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<HashIDs>();

        // Set the weight of the shouting layer to 1.
        anim.SetLayerWeight(1, 1f);
    }
コード例 #28
0
ファイル: PlayerMovement.cs プロジェクト: yoe32/Proyecto-4
 void Awake()
 {
     animator = GetComponent<Animator> ();
     hash = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent < HashIDs> ();
     bulletShooting = GameObject.FindGameObjectsWithTag("PlayerBullet");
     countdownController = GameObject.FindGameObjectWithTag (Tags.gameController);
     rigidbody = GetComponent<Rigidbody> ();
     animator.SetLayerWeight (1, 1f);
 }
コード例 #29
0
 void Start()
 {
     playerPhysics = GetComponent<PlayerPhysics>();
     animator = GetComponent<Animator>();
     manager = Camera.main.GetComponent<GameManager>();
     animator.SetLayerWeight(1,1);
     throwing = false;
     facingRight = true;
 }
コード例 #30
0
	void Start ()
	{
		// initialising reference variables
		anim = GetComponent<Animator>();					  
		col = GetComponent<CapsuleCollider>();				
		enemy = GameObject.Find("Enemy").transform;	
		if(anim.layerCount ==2)
			anim.SetLayerWeight(1, 1);
	}
コード例 #31
0
ファイル: Animator.cs プロジェクト: herpdederp/rust-sdk
        public static void SetLayersWeight(this Animator anim, string strNamePartial, float fWeight)
        {
            for (int i = 0; i < anim.layerCount; i++)
            {
                string strName = anim.GetLayerName(i);
                if (!strName.StartsWith(strNamePartial))
                {
                    continue;
                }

                anim.SetLayerWeight(i, fWeight);
            }
        }
コード例 #32
0
 public override void OnEnter()
 {
     animator = ownerDefault.GetComponent <UnityEngine.Animator> ();
     animator.SetLayerWeight(layer, owner.GetValue(weight));
     Finish();
 }
コード例 #33
0
 public override void OnEnter()
 {
     animator.SetLayerWeight(layer, weight);
     Finish();
 }