當前位置: 首頁>>代碼示例>>C#>>正文


C# Animator.GetBehaviour方法代碼示例

本文整理匯總了C#中Animator.GetBehaviour方法的典型用法代碼示例。如果您正苦於以下問題:C# Animator.GetBehaviour方法的具體用法?C# Animator.GetBehaviour怎麽用?C# Animator.GetBehaviour使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Animator的用法示例。


在下文中一共展示了Animator.GetBehaviour方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Start

    // Use this for initialization
    void Start()
    {
        _animator = gameObject.GetComponentInChildren<Animator> ();
        w = _animator.GetBehaviour<Walk> ();

        w.Init (velocity, transform);
    }
開發者ID:albertus88,項目名稱:demo,代碼行數:8,代碼來源:Character.cs

示例2: Start

 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animator>();
     stateGlow = Animator.StringToHash("Photo.Glow");
     beh = anim.GetBehaviour<StateEventBehaviour>();
     beh.StateEntered += Beh_StateEntered;
     currentSprite = EmptySprite;
     img = GetComponent<Image>();
 }
開發者ID:algol001,項目名稱:CSVRTutorial_Unity,代碼行數:10,代碼來源:PageImageScript.cs

示例3: Awake

    void Awake()
    {
        animatorController = this.GetComponent<Animator>();

        if (animatorController == null) throw new MissingReferenceException("Missing a reference to the PlayerAnimatorControler on the " + this.gameObject);

        camera = this.GetComponent<Transform>();

        var zoomOutState  = animatorController.GetBehaviour<AnimationStateEventDelegator>();
        zoomOutState.OnExit += OnZoomOutExit;
    }
開發者ID:elzayat-mohamed,項目名稱:BATPeople,代碼行數:11,代碼來源:CameraController.cs

示例4: Start

    // Use this for initialization
    void Start()
    {
        firstMesh = FirstPage.GetComponent<MeshRenderer>();
        secondMesh = SecondPage.GetComponent<MeshRenderer>();
        cont = FPSPlayer.GetComponent<PlayerController>();

        anim = GetComponent<Animator>();
        beh = anim.GetBehaviour<StateEventBehaviour>();
        beh.StateEntered += Beh_StateEntered;
        beh.StateExited += Beh_StateExited;

        idleState = Animator.StringToHash("Notebook.Idle");
        forwardState = Animator.StringToHash("Notebook.Forward");
        backwardState = Animator.StringToHash("Notebook.Backward");
        closedState = Animator.StringToHash("Notebook.Closed");
        lastInfo = anim.GetCurrentAnimatorStateInfo(0);
        audioSource = GetComponent<AudioSource>();
    }
開發者ID:algol001,項目名稱:CSVRTutorial_Unity,代碼行數:19,代碼來源:NotebookScript.cs

示例5: ResetStateManager

 public void ResetStateManager(Animator _animator)
 {
     attackState = _animator.GetBehaviour<CharacterAttackState> ();
     deadState = _animator.GetBehaviour<CharacterDeadState> ();
     skillState = _animator.GetBehaviour<CharacterSkillState>();
 }
開發者ID:dsanekata,項目名稱:BattleMock_2D,代碼行數:6,代碼來源:CharacterAnimationStateManager.cs

示例6: Start

    // Use this for initialization
    void Start()
    {
        cont = FPSPlayer.GetComponent<PlayerController>();
        parts = GetComponent<ParticleSystem>();
        targetScript = TargetImage.GetComponent<PageImageScript>();
        nbscript = Notebook.GetComponent<NotebookScript>();

        stateSpinning = Animator.StringToHash("Card.Spinning");
        stateStopped = Animator.StringToHash("Card.Stopped");
        statePutaway = Animator.StringToHash("Card.Putaway");

        anim = GetComponentInChildren<Animator>();
        beh = anim.GetBehaviour<StateEventBehaviour>();
        beh.StateEntered += Beh_StateEntered;
        beh.StateExited += Beh_StateExited;
        //        linkedScripts = LinkedCards.Select(i => i.GetComponent<CardScript>()).ToArray();
    }
開發者ID:algol001,項目名稱:CSVRTutorial_Unity,代碼行數:18,代碼來源:CardScript.cs

示例7: Start

 // Use this for initialization
 void Start()
 {
     m_characterCtrl = GetComponent<CharacterController>();
     m_animator = GetComponent<Animator>();
     damageController = GetComponent<DamageController>();
     AttackBehaviour ab = m_animator.GetBehaviour<AttackBehaviour>();
     //ab.damageController = damageController;
     target = GameObject.Find("ashe");
     navAgent = GetComponent<NavMeshAgent>();
     Shader.WarmupAllShaders();
 }
開發者ID:exolution,項目名稱:cosmic-editor,代碼行數:12,代碼來源:MainActorController.cs

示例8: Start

    // SAMPLE TEXT  that is hardcoded for now//
    // -- Can be somewhat dynamic later on -- //
    // Use this for initialization
    void Start()
    {
        //menuCanvas.SetActive(false);

        animator = animator.GetComponent<Animator>();

        portrait = portrait.GetComponent<Image>();

        animator.GetBehaviour <TransClass> ().transition=nextScene;

        for(int i=0; i< charsToLoad; ++i)
            charImg[i]=charImg[i].GetComponent<Image>();

        charName = charName.GetComponent<Text>();
        continueText=continueText.GetComponent<Button>();
        convoText= convoText.GetComponent<Button>();

        portrait.sprite=charImg[person[currPart]].sprite;
        charName.text=charImg[person[currPart]].tag;
        convoText.GetComponentInChildren<Text>().text=speech[currPart++];
        //menuCanvas.SetActive();
    }
開發者ID:jegriffi,項目名稱:SeanJamesMattAndrew,代碼行數:25,代碼來源:TalkingScript.cs


注:本文中的Animator.GetBehaviour方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。