本文整理汇总了C#中UnityEngine.Animator类的典型用法代码示例。如果您正苦于以下问题:C# Animator类的具体用法?C# Animator怎么用?C# Animator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Animator类属于UnityEngine命名空间,在下文中一共展示了Animator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: HeroState
public HeroState(FSM fsm)
: base(fsm)
{
Hero = (HeroMotion)fsm;
animator = gameObject.GetComponent<Animator>();
InputManager = gameObject.GetComponent<InputManager>();
}
开发者ID:ZeroXFive7,项目名称:NextGenPlatformer,代码行数:7,代码来源:HeroState.cs
示例17: Start
// Use this for initialization
void Start()
{
var observableUpdate = GetComponent<ObservableUpdateTrigger>();
var observableFixedUpdate = GetComponent<ObservableFixedUpdateTrigger>();
if (observableUpdate == null)
{
observableUpdate = gameObject.AddComponent<ObservableUpdateTrigger>();
}
if (observableFixedUpdate == null)
{
observableFixedUpdate = gameObject.AddComponent<ObservableFixedUpdateTrigger>();
}
animator = GetComponentInChildren<Animator>();
pause.OnPauseEnterAsObservable()
.Subscribe(_ =>
{
observableUpdate.enabled = false;
observableFixedUpdate.enabled = false;
animator.enabled = false;
});
pause.OnPauseExitAsObservable()
.Subscribe(_ =>
{
observableUpdate.enabled = true;
observableFixedUpdate.enabled = true;
animator.enabled = true;
});
}
开发者ID:MAX-eipi,项目名称:NOBOTTOWER,代码行数:34,代码来源:PlayerPause.cs
示例18: Start
// Use this for initialization
void Start()
{
animator = GetComponent<Animator>();
blur = GetComponent<Blur>();
int min = 0;
int max = 5;
float time = 0.1f;
pause.OnPauseEnterAsObservable()
.Subscribe(_ => iTween.ValueTo(gameObject,
iTween.Hash(
"from", min,
"to", max,
"time", time,
"onupdate", "OnUpdateOnPauseTransition",
"onstart", "OnStartOnPauseEnter")));
// .Subscribe(_ => animator.SetBool("isPausing", true));
pause.OnPauseExitAsObservable()
.Subscribe(_ => iTween.ValueTo(gameObject,
iTween.Hash(
"from", max,
"to", min,
"time", time,
"onupdate", "OnUpdateOnPauseTransition",
"oncomplete", "OnCompleteOnPauseExit")));
// .Subscribe(_ => animator.SetBool("isPausing", false));
}
开发者ID:MAX-eipi,项目名称:NOBOTTOWER,代码行数:30,代码来源:CameraPause.cs
示例19: Start
private void Start() {
_rigidbody = GetComponent<Rigidbody>();
_animator = GetComponent<Animator>();
// Automatically rotate player to initial direction
if (_facingRight) {
transform.rotation = _rightRotation;
_rotationAmount = +1.0f;
}
else {
transform.rotation = _leftRotation;
_rotationAmount = -1.0f;
}
var virtualJoystickGameObject = GameObject.Find("Virtual Joystick");
if (virtualJoystickGameObject != null) {
virtualJoystick = virtualJoystickGameObject.GetComponent<HatGuyJoystick>();
virtualButton = virtualJoystickGameObject.GetComponent<HatGuyTouchButton>();
}
#if !(UNITY_IPHONE || UNITY_ANDROID)
// Virtual joystick not needed for non-touch devices!
if (virtualJoystick != null)
Destroy(virtualJoystick.gameObject);
#endif
}
开发者ID:Quantarium-Studios,项目名称:Gem_Hunter,代码行数:26,代码来源:HatGuyCharacterController.cs
示例20: Awake
//===================================================
// UNITY METHODS
//===================================================
/// <summary>
/// Awake.
/// </summary>
void Awake()
{
health = GetComponent<Health>();
hitFlash = GetComponent<HitFlash>();
startingHealth = health.HealthValue;
a = footman.GetComponent<Animator>();
}
开发者ID:hadeszs,项目名称:TowerDefence-orign,代码行数:13,代码来源:Enemy.cs
注:本文中的UnityEngine.Animator类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论