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


C# Animator.GetBehaviours方法代碼示例

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


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

示例1: InitialAnim

    void InitialAnim()
    {
        mAnim = GetComponent<Animator>();

        if(mAnim != null)
        {
            Monitor[] monitors = mAnim.GetBehaviours<Monitor>();
            for (int Indx = 0; Indx < monitors.Length; ++Indx)
                monitors [Indx].AnimationEventFunc = AnimEventHandle;

            CameraTypeId = Animator.StringToHash ("CameraType");
        }
    }
開發者ID:Genesic,項目名稱:WarGamingProject,代碼行數:13,代碼來源:CameraController.cs

示例2: Start

	void Start () {
		// fighter is the model, fighterAnimator is the animation controller, we need access to it here in order
		// to set the correct bools that trigger different animation states
		fighterAnimator = fighter.GetComponent<Animator> ();
		// Capture the animation behaviors that underlie each state.  
		animatedBehaviours = fighterAnimator.GetBehaviours<BufferedStateMachineBehaviour>();

		UnityEngine.Debug.Log ("PWD: " + Directory.GetParent(Directory.GetCurrentDirectory()).FullName);

		health = 1000.0f; // Debug for animation
		maxHealth = health;

		gravity = 0.05f;
		initialJumpVelocity = .61f;

		blockPercentage = 1.0f;

		reach = 0.0f;
		attackDamage = 0.0f;
		lowAttack = false;
		inputHold = false;
		attackWasThrown = false;
		attackWasFinished = false;
		attackHit = false;
		blocking = false;
		lowBlocking = false;

		GameObject MIObj = GameObject.Find ("Info");
		MenuInfo MI_gd = MIObj.GetComponent<MenuInfo> ();
		if (player1) {
			if (MI_gd.isp1AI ()) {
				setPlayerAI ();
			}
				

			playerBodyBox = GameObject.Find ("Player1BodyBox");
			playerHitBox = GameObject.Find ("Player1HitBox");
			playerBlockBox = GameObject.Find ("Player1BlockBox");

			if (isAI) {
				int inPort = 4998;

				playerAI = new AI (inPort, inPort + 1);
				playerAI.verifyNetwork ();

			} else {
				Up = KeyCode.W;
				Down = KeyCode.S;
				Left = KeyCode.A;
				Right = KeyCode.D;
				Run = KeyCode.LeftShift;
				Attack1 = KeyCode.Q;
				Attack2 = KeyCode.E;
				Block = KeyCode.F;
			}

		} else { // player 2
			if (MI_gd.isp2AI ()) {
				setPlayerAI ();
			}
			playerBodyBox = GameObject.Find ("Player2BodyBox");
			playerHitBox = GameObject.Find ("Player2HitBox");
			playerBlockBox = GameObject.Find ("Player2BlockBox");

			if (isAI){
				int inPort = 5998;

				playerAI = new AI (inPort, inPort + 1);
				playerAI.verifyNetwork ();
			} else {
				Up = KeyCode.I;
				Down = KeyCode.K;
				Left = KeyCode.J;
				Right = KeyCode.L;
				Run = KeyCode.RightShift;
				Attack1 = KeyCode.U;
				Attack2 = KeyCode.O;
				Block = KeyCode.H;
			}

		}
	}
開發者ID:rhyschris,項目名稱:CS194Project,代碼行數:82,代碼來源:PlayerController.cs

示例3: Awake

 void Awake()
 {
     // Find a reference to the Animator component in Awake since it exists in the scene.
     animator = GetComponent <Animator> ();
     if (animator) {
         CreatureStateMachineBehavior[] all_behaviors = animator.GetBehaviours<CreatureStateMachineBehavior>();
         for(int i=0;i<all_behaviors.Length;i++)
         {
             all_behaviors[i].game_controller = this;
         }
     }
 }
開發者ID:kestrelm,項目名稱:CreatureDemos,代碼行數:12,代碼來源:CreatureGameController.cs

示例4: Start

    void Start()
    {
        animator = GetComponent<Animator>();
        foreach(SlidingDoorStateBehaviour behaviour in animator.GetBehaviours<SlidingDoorStateBehaviour>()) {
            behaviour.AddListener(this);
        }

        for(int i=0; i<floorPositions.Length; i++) {
            floorPositions[i].y = floorPositions[0].y + i * GameController.floorHeight;
        }

        currentTargetFloor = currentFloor;
        positionDriver = new TransformAnimator();
        targetFloors = 0;
        transform.position = GetFloorPosition(currentFloor);
    }
開發者ID:theabeing,項目名稱:studierturm-simulator,代碼行數:16,代碼來源:Elevator.cs

示例5: InitialAnim

    void InitialAnim()
    {
        mAnim = GetComponent<Animator>();
        Monitor[] monitors = mAnim.GetBehaviours<Monitor>();
        for (int Indx = 0; Indx < monitors.Length; ++Indx)
            monitors [Indx].AnimationEventFunc = AnimEventHandle;

        AttackTypeId = Animator.StringToHash ("AttackType");
        ActionTypeId = Animator.StringToHash ("ActionType");
        triggerActionId = Animator.StringToHash ("triggerAction");
    }
開發者ID:Genesic,項目名稱:WarGamingProject,代碼行數:11,代碼來源:UnityChanController.cs


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