本文整理汇总了C#中Animator.Play方法的典型用法代码示例。如果您正苦于以下问题:C# Animator.Play方法的具体用法?C# Animator.Play怎么用?C# Animator.Play使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animator
的用法示例。
在下文中一共展示了Animator.Play方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadPuzzleSelectMenu
IEnumerator LoadPuzzleSelectMenu(GameObject puzzleGamePanel, Animator puzzleGamePanelAnim) {
puzzleLevelSelectPanel.SetActive(true);
puzzleGamePanelAnim.Play("Slidein");
puzzleGamePanelAnim.Play("Slideout");
yield return new WaitForSeconds(1f);
puzzleGamePanel.SetActive(false);
}
示例2: Movement
void Movement()
{
var bit = GameObject.Find("Bit");
anim = gameObject.GetComponent<Animator> ();
if(Input.GetKey (KeyCode.D)) {
bit.transform.Translate (Vector2.right * speed * (Time.deltaTime));
anim.Play ("Bit_WalkRight");
}
if (Input.GetKey (KeyCode.A)) {
bit.transform.Translate (-Vector2.right * speed * (Time.deltaTime));
anim.Play ("Bit_WalkLeft");
}
if (Input.GetKey (KeyCode.W)) {
bit.transform.Translate (Vector2.up * speed * (Time.deltaTime));
anim.Play ("Bit_WalkUp");
}
if (Input.GetKey (KeyCode.S)) {
bit.transform.Translate (Vector2.down * speed * (Time.deltaTime));
anim.Play ("Bit_WalkDown");
}
}
示例3: Start
// Use this for initialization
void Start()
{
isHit = false;
animator = GetComponent<Animator>();
//animator.StartPlayback();
animator.SetBool("IsIdle", startIdle);
isWalking = !startIdle;
if(startIdle)
{
animator.Play("SpiderIdle", -1, 1f);
}
else
{
animator.Play("SpiderWalk", -1, 1f);
}
startPoint = transform.position;
endPoint = new Vector3(transform.position.x + (startTowardsLeft ? -distanceToTravel: distanceToTravel) / 72f, transform.position.y, transform.position.z);
totalDistanceTravelled = 0f;
if(startTowardsLeft)
{
transform.localScale = new Vector3(-transform.localScale.x, transform.localScale.y, transform.localScale.z);
Vector3 tmp = endPoint;
endPoint = startPoint;
startPoint = tmp;
startTowardsLeft = !startTowardsLeft;
}
Debug.Log(startPoint.ToString() + " " + endPoint.ToString());
}
示例4: Start
void Start()
{
anim = GetComponent<Animator>();
if(PlayerPrefs.GetString("escaleraOpen") == "closed"){
anim.Play ("escaleraClosed");
}else{
anim.Play ("escaleraOpened");
HabilitarSubida();
this.collider2D.enabled = false;
}
//PlayerPrefs.SetString("playerInstance","SwampHouse3");
animations = (Animations)GameObject.FindObjectOfType(typeof(Animations));
playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove));
}
示例5: Start
void Start()
{
playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove));
animations = (Animations)GameObject.FindObjectOfType(typeof(Animations));
gui = (Gui)GameObject.FindObjectOfType(typeof(Gui));
inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory));
anim = GetComponent<Animator>();
if(PlayerPrefs.GetInt("doorInOpen") == 0){
anim.Play("doorInClosed");
}else{
this.collider2D.enabled = false;
this.gameObject.tag = "Untagged";
anim.Play("doorInOpened");
}
}
示例6: Init
public void Init(PowerupManager.types type)
{
if(Data.Instance.musicManager.volume==1)
Events.OnMusicVolumeChanged(0.2f);
anim = GetComponent<Animator>();
anim.updateMode = AnimatorUpdateMode.UnscaledTime;
Invoke("onComplete", 0.1f);
anim.Play("powerupSign", 0, 0);
switch (type)
{
case PowerupManager.types.CHUMBO:
title.text = "MEGA-CHUMBO";
desc.text = "TREMENDO CHUMBO + 1 AGUANTE";
break;
case PowerupManager.types.GIL:
title.text = "GIL-POWA";
desc.text = "PODER DE EXTRA PUNGUEO + 1 AGUANTE";
break;
case PowerupManager.types.MOTO:
title.text = "RATI-CICLO";
desc.text = "APLASTA COBANIS Y CIVILES + 1 AGUANTE";
break;
}
Time.timeScale = 0.05f;
}
示例7: CollectRing
public void CollectRing()
{
_animator = GetComponent<Animator>();
_animator.Play("Ring_Hit");
if (!_collected) { GetComponent<AudioSource>().Play(); }
_collected = true;
}
示例8: Start
void Start()
{
toggles = GameObject.Find("TowerChoice").GetComponentsInChildren<Toggle>();
choiceTowers = new Dictionary<TglTower, Tower>();
retrieveChoiceTowers();
DisableChoices();
title = GameObject.Find("txtTitle");
title.SetActive(false);
smallTitle = GameObject.Find("txtSmallTitle");
tiltShift = GameObject.Find("Main Camera").GetComponent<UnityStandardAssets.ImageEffects.TiltShift>();
spawnLaps = 2;
spawner = GameObject.Find("Spawn").GetComponentInChildren<Spawn>();
step = Step.STARTING;
shakeAmount = 0.1F;
shakeTimer = 1F;
HideTowerDetails();
btnNextWave.onClick.AddListener(EndConstructionTime);
nextWave = GameObject.Find("btnNextWave");
nextWave.SetActive(false);
animator = ((Animator)GetComponent<Animator>());
topCam = (Camera) topCamObject.GetComponent<Camera> ();
animator.Play("CameraStartAnim", -1, 0F);
startTimer = Time.time;
}
示例9: Start
// Use this for initialization
void Start()
{
eating = true;
pacman = GameObject.Find("pacman");
Laika = GetComponent<Animator>();
Laika.Play("Eating");
}
示例10: Start
void Start()
{
anim = GetComponent<Animator>();
animations = (Animations)GameObject.FindObjectOfType(typeof(Animations));
playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove));
anim.Play("ramasIdle");
}
示例11: Activate
public void Activate(panelState state)
{
anim = gameObject.GetComponent<Animator>();
gameObject.SetActive(true);
currentState = state;
anim.Play("PopupOpen");
}
示例12: Start
// Use this for initialization
void Start()
{
//swordEdge = GetComponent<Ray> ();
pos = GetComponent<Transform> ();
anim = GetComponent<Animator> ();
anim.Play ("idle");
}
示例13: Start
// Use this for initialization
void Start()
{
animator = GetComponent<Animator>();
animator.Play("DayNight", -1, Game.CurrentTime / 24f);
animator.speed = 0f;
}
示例14: Start
/*=========================== Methods ===================================================*/
/*=========================== Start() ===================================================*/
void Start () {
// get reference to DefenceTower object
defenceTower = gameObject.GetComponentInParent<DefenceTower> ().defenceTower;
// set the projectile speed
projectileSpeed = defenceTower.GetComponent<DefenceTower>().projectileSpeed;
// set projectile damage
projectileDamage = defenceTower.GetComponent<DefenceTower>().projectileDamage;
// get the reference to the target enemy
target = defenceTower.GetComponent<DefenceTower> ().enemyTarget;
// set animation to not finished
animationFinished = false;
// get reference to animator
anim = GetComponent<Animator>();
if (defenceTower.tag == "TowerLvl4") {
// run animation Projectile gets bigger
anim.Play("ProjectileGetsBigger", 0, 0f);
} else { // if not lvl 4 tower
// animation does not play
animationFinished = true;
} // if
} // Start()
示例15: ClickToLogin
public void ClickToLogin()
{
animator = GameObject.Find("/Login").GetComponent<Animator>();
hint.text = "";
ar.pushToList("CloseRegister");
animator.Play("CloseRegister");
}