本文整理汇总了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>();
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例7: Awake
private void Awake()
{
// Setting up references.
groundCheck = transform.Find("GroundCheck");
ceilingCheck = transform.Find("CeilingCheck");
anim = GetComponent<Animator>();
}
示例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");
}
示例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();
}
示例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;
}
}
示例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();
}
}
示例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();
}
示例13: Start
// Use this for initialization
void Start()
{
animator = GetComponent<Animator>();
GetNickname ();
camera = FindObjectOfType<CameraControllerMainMenu>();
}
示例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>();
}
示例15: OnStart
public override void OnStart()
{
GetComponent<Animator> ().Play ("hurt");
animator = GetComponent<Animator> ();
tree = GetComponent<BehaviorTree> ();
hurted = (SharedBool)tree.GetVariable ("hurted");
}