UnityEngine.AnimatorStateInfo.IsName C# (CSharp) Method

IsName() public method

Does name match the name of the active state in the statemachine?

public IsName ( string name ) : bool
name string
return bool
        public bool IsName(string name)
        {
            int num = Animator.StringToHash(name);
            return (((num == this.m_FullPath) || (num == this.m_Name)) || (num == this.m_Path));
        }

Usage Example

コード例 #1
0
ファイル: piscar.cs プロジェクト: fayvit/PQP
    // Update is called once per frame
    void Update()
    {
        tempo+=Time.deltaTime;

        if(animator)
        {
            animaState = animator.GetCurrentAnimatorStateInfo(0);
            if(animaState.IsName("padrao")){
                if(tempo>TEMPO_DE_PISCAR )
                {
                    piscarAgora();
                }
            }else if(animaState.IsName("cair")){
                material.mainTextureOffset = new Vector3(3*deslocamento,0);
            }else if(animaState.IsName("dano1")){
                tempo = TEMPO_DE_PISCAR;
                piscarAgora();
            }else
                material.mainTextureOffset = new Vector3(0,0);
        }else
        {
            animator = GetComponent<Animator>();
            if(animator)
                animaState = animator.GetCurrentAnimatorStateInfo(0);
        }
    }
All Usage Examples Of UnityEngine.AnimatorStateInfo::IsName
AnimatorStateInfo