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


C# UnityEngine.Animator类代码示例

本文整理汇总了C#中UnityEngine.Animator的典型用法代码示例。如果您正苦于以下问题:C# Animator类的具体用法?C# Animator怎么用?C# Animator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Animator类属于UnityEngine命名空间,在下文中一共展示了Animator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Awake

 void Awake()
 {
     m_myRigid = GetComponent<Rigidbody>();
     m_anim = GetComponent<Animator>();
     m_shipStates = GetComponent<StateManager>();
     m_passTray = GetComponentInChildren<PassengerTray>();
 }
开发者ID:patferguson,项目名称:Storms-Project,代码行数:7,代码来源:AirshipDyingBehaviour.cs

示例2: OnEnter

		public override void OnEnter()
		{
			// get the animator component
			var go = Fsm.GetOwnerDefaultTarget(gameObject);
			
			if (go==null)
			{
				Finish();
				return;
			}
			
			_animator = go.GetComponent<Animator>();
			
			if (_animator==null)
			{
				Finish();
				return;
			}
			
			_locomotion = new Locomotion(_animator);
			
			SetLocomotion();
			
			if (!everyFrame) 
			{
				Finish();
			}
		}
开发者ID:shaunus84,项目名称:through-shadows,代码行数:28,代码来源:DoLocomotion.cs

示例3: OnEnter

		public override void OnEnter()
		{
			// get the animator component
			var go = Fsm.GetOwnerDefaultTarget(gameObject);
			
			if (go==null)
			{
				Finish();
				return;
			}
			
			_animator = go.GetComponent<Animator>();
			
			if (_animator==null)
			{
				Finish();
				return;
			}
			
			_animatorProxy = go.GetComponent<PlayMakerAnimatorMoveProxy>();
			if (_animatorProxy!=null)
			{
				_animatorProxy.OnAnimatorMoveEvent += OnAnimatorMoveEvent;
			}
			
			
			DoCheckPivot();
			
			if (!everyFrame)
			{
				Finish();
			}
		}
开发者ID:SpacesAdventure,项目名称:Kio-2,代码行数:33,代码来源:GetAnimatorPivot.cs

示例4: OnEnter

        public override void OnEnter()
        {
            // get the animator component
            var go = Fsm.GetOwnerDefaultTarget(gameObject);

            if (go==null)
            {
                Finish();
                return;
            }

            _animator = go.GetComponent<Animator>();

            if (_animator==null)
            {
                Finish();
                return;
            }

            GameObject _goal = goal.Value;
            if (_goal!=null)
            {
                _transform = _goal.transform;
            }

            DoGetIKGoal();

            if (!everyFrame)
            {
                Finish();
            }
        }
开发者ID:yulcat,项目名称:GameCamp,代码行数:32,代码来源:GetAnimatorIKGoal.cs

示例5: OnEnter

		public override void OnEnter()
		{
			// get the animator component
			var go = Fsm.GetOwnerDefaultTarget(gameObject);
			
			if (go==null)
			{
				Finish();
				return;
			}
			
			_animator = go.GetComponent<Animator>();
			
			if (_animator==null)
			{
				Finish();
				return;
			}
			
			DoLayerWeight();
			
			if (!everyFrame) 
			{
				Finish();
			}
		}
开发者ID:SpacesAdventure,项目名称:Kio-2,代码行数:26,代码来源:SetAnimatorLayerWeight.cs

示例6: OnEnter

        public override void OnEnter()
        {
            // get the animator component
            var go = Fsm.GetOwnerDefaultTarget(gameObject);

            if (go==null)
            {
                Finish();
                return;
            }

            _animator = go.GetComponent<Animator>();

            if (_animator==null)
            {
                Finish();
                return;
            }

            // get hash from the param for efficiency:
            _paramID = Animator.StringToHash(parameter.Value);

            GetParameter();

            if (!everyFrame)
            {
                Finish();
            }
        }
开发者ID:ChetahPangestu,项目名称:MajorProjectReveal,代码行数:29,代码来源:GetAnimatorFloat.cs

示例7: Awake

 private void Awake()
 {
     // Setting up references.
        groundCheck = transform.Find("GroundCheck");
        ceilingCheck = transform.Find("CeilingCheck");
     anim = GetComponent<Animator>();
 }
开发者ID:kahojon,项目名称:InfiniteSidescroller,代码行数:7,代码来源:PlatformerCharacter2D.cs

示例8: Start

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

            highscore = ProgressManager.GetProgress().highscores.Find(x => x.levelId == id);
            if (highscore != null && highscore.starCount > 0)
            {
                starScore = highscore.starCount;
            }
            else
            {
                starScore = 0;
            }

            Main.onSceneChange.AddListener(SceneChanged);

            Highscore.onStarChange.AddListener(HighscoreStarChanged);

            UpdateUILevel();

            if (createdByLevelswitch)
                animator.SetTrigger("levelswitch");
            else
                animator.SetTrigger("fadein");
        }
开发者ID:Badeye,项目名称:impulse,代码行数:25,代码来源:UILevel.cs

示例9: Start

        void Start()
        {
            anim	= gameObject.GetComponent<Animator>();

            Animations	= anim.runtimeAnimatorController.animationClips;
            Animations	= Animations.Where((animation) => animation.name.Contains("@sd_")).OrderBy((animation) => animation.name).ToArray();
        }
开发者ID:Thaina,项目名称:UnityChanSD,代码行数:7,代码来源:FaceUpdate.cs

示例10: OnEnter

		// Code that runs on entering the state.
		public override void OnEnter()
		{
			
			// get the animator component
			var go = Fsm.GetOwnerDefaultTarget(gameObject);
			
			if (go==null)
			{
				Finish();
				return;
			}
			_agent = go.GetComponent<NavMeshAgent>();
			
			
			_animator = go.GetComponent<Animator>();
			
			if (_animator==null)
			{
				Finish();
				return;
			}
			
			_trans = go.transform;
			
			_animatorProxy = go.GetComponent<PlayMakerAnimatorMoveProxy>();
			if (_animatorProxy!=null)
			{
				_animatorProxy.OnAnimatorMoveEvent += OnAnimatorMoveEvent;
			}
	
		}
开发者ID:SpacesAdventure,项目名称:Kio-2,代码行数:32,代码来源:NavMeshAgentAnimatorSynchronizer.cs

示例11: OnEnter

 public override void OnEnter()
 {
     GameObject ownerDefaultTarget = base.Fsm.GetOwnerDefaultTarget(this.gameObject);
     if (ownerDefaultTarget == null)
     {
         base.Finish();
         return;
     }
     this._animator = ownerDefaultTarget.GetComponent<Animator>();
     if (this._animator == null)
     {
         base.Finish();
         return;
     }
     this._animatorProxy = ownerDefaultTarget.GetComponent<PlayMakerAnimatorIKProxy>();
     if (this._animatorProxy != null)
     {
         this._animatorProxy.OnAnimatorIKEvent += new Action<int>(this.OnAnimatorIKEvent);
     }
     else
     {
         Debug.LogWarning("This action requires a PlayMakerAnimatorIKProxy. It may not perform properly if not present.");
     }
     GameObject value = this.goal.Value;
     if (value != null)
     {
         this._transform = value.transform;
     }
     this.DoSetIKGoal();
     if (!this.everyFrame)
     {
         base.Finish();
     }
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:34,代码来源:SetAnimatorIKGoal.cs

示例12: OnEnter

		public override void OnEnter()
		{
			// get the animator component
			var go = Fsm.GetOwnerDefaultTarget(gameObject);
			
			if (go==null)
			{
				Finish();
				return;
			}
			
			_animator = go.GetComponent<Animator>();
			
			if (_animator==null)
			{
				Finish();
				return;
			}
			
			GameObject targetGo = transform.Value;
			
			if (targetGo==null)
			{
				Finish();
				return;
			}
				
			_transform = targetGo.transform;
			
			DoCheckIsControlled();
			
			Finish();
			
		}
开发者ID:hazzed,项目名称:Smackitball-the-game-,代码行数:34,代码来源:GetAnimatorIsControlled.cs

示例13: Start

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

            GetNickname ();
            camera = FindObjectOfType<CameraControllerMainMenu>();
        }
开发者ID:Kundara,项目名称:project1,代码行数:8,代码来源:MainMenu.cs

示例14: Awake

        private bool m_FacingRight = true;  // For determining which way the player is currently facing.

        private void Awake()
        {
            // Setting up references.
            m_GroundCheck = transform.Find("GroundCheck");
            m_Anim = GetComponent<Animator>();
            m_Rigidbody2D = GetComponent<Rigidbody2D>();
        }
开发者ID:flatlineteam,项目名称:CartoonNetworkJam-Zer0,代码行数:9,代码来源:PlatformerCharacter2D.cs

示例15: OnStart

 public override void OnStart()
 {
     GetComponent<Animator> ().Play ("hurt");
     animator = GetComponent<Animator> ();
     tree = GetComponent<BehaviorTree> ();
     hurted = (SharedBool)tree.GetVariable ("hurted");
 }
开发者ID:wishes2018,项目名称:UnityGame,代码行数:7,代码来源:Hurt.cs


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