本文整理汇总了C#中UnityEngine.Animator.GetInteger方法的典型用法代码示例。如果您正苦于以下问题:C# Animator.GetInteger方法的具体用法?C# Animator.GetInteger怎么用?C# Animator.GetInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Animator
的用法示例。
在下文中一共展示了Animator.GetInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnStateEnter
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if(animator.gameObject.GetComponent<Enemy>().indexPos == 0){
if(animator.GetInteger("attack") == 1){
GameObject EarthBend = (GameObject)Instantiate(Resources.Load("EarthBend", typeof(GameObject)), GameObject.Find("skillSpawn(1)").transform.position, GameObject.Find("skillSpawn(1)").transform.rotation);
EarthBend.GetComponent<Rigidbody>().velocity = EarthBend.transform.TransformDirection(Vector3.forward * 15);
EarthBend.transform.FindChild("source").gameObject.tag = "Enemy1Attack";
}
}
if(animator.gameObject.GetComponent<Enemy>().indexPos == 1){
if(animator.GetInteger("attack") == 1){
GameObject EarthBend = (GameObject)Instantiate(Resources.Load("EarthBend", typeof(GameObject)), GameObject.Find("skillSpawn(2)").transform.position, GameObject.Find("skillSpawn(2)").transform.rotation);
EarthBend.GetComponent<Rigidbody>().velocity = EarthBend.transform.TransformDirection(Vector3.forward * 15);
EarthBend.transform.FindChild("source").gameObject.tag = "Enemy2Attack";
}
}
if(animator.gameObject.GetComponent<Enemy>().indexPos == 2){
if(animator.GetInteger("attack") == 1){
GameObject EarthBend = (GameObject)Instantiate(Resources.Load("EarthBend", typeof(GameObject)), GameObject.Find("skillSpawn(3)").transform.position, GameObject.Find("skillSpawn(3)").transform.rotation);
EarthBend.GetComponent<Rigidbody>().velocity = EarthBend.transform.TransformDirection(Vector3.forward * 15);
EarthBend.transform.FindChild("source").gameObject.tag = "Enemy3Attack";
}
}
}
示例2: OnStateEnter
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if (animator.GetInteger (AnimParameter.state) != state) {
Debug.Log (animator.GetInteger (AnimParameter.state).
ToString()+state);
animator.SetInteger ("state", state);
}
}
示例3: OnStateEnter
// private AnotherScript anotherScript;
//private GameObject otherScript;
//OtherScript = GetComponent(OtherScript);
//public GameObject objectToAccess;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
cartucho = GameObject.Find ("/FPSController/FirstPersonCharacter/armas/animacionColt44-40/cartucho_006");
m =cartucho.GetComponent<SkinnedMeshRenderer>();
m.enabled = false;
//Instantiate(flash,);
casquillos = animator.GetInteger ("casquillos");
//GameObject Object1 = GameObject.Find ("armas");
//Component anotherScript = Object1.GetComponent<disparosDelJugador> ();
disparo = GameObject.Find ("armas").GetComponent<disparosDelJugador> ();
disparo.disparo (3);
anim = GameObject.Find ("animacionColt44-40").GetComponent<Animator> ();
anim.SetInteger ("cartuchos",anim.GetInteger("cartuchos")-1);
//Transform bone = GetComponent<Animator>().avatar.GetBone(BoneType.LeftShoulder);
objetin = GameObject.FindGameObjectsWithTag ("canionColt");
posicionHueso = objetin [0].transform;
Debug.Log("Posicion del hgueso -----------------"+posicionHueso.position+"----------------------");
Instantiate (esfera, posicionHueso.position,posicionHueso.rotation);
// Script1.disparo ();
/*abtenemos posicion del
posicion = GameObject.Find ("/FPSController/FirstPersonCharacter/armas/animacionColt44-40/marco").GetComponent<Transform>();
Debug.Log ("+++++++++++ la poscion del flash es: " + posicion.position + "+++++++++++++++++++");canion*/
/*obtenemos un hueso*/
}
示例4: OnStateExit
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if(safeAttack<animator.GetInteger("Attack"))
animator.SetInteger("Attack",1);
else
animator.SetInteger("Attack",0);
}
示例5: OnStateExit
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
//override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
//override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//}
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
var currentDirection = (Direction)animator.GetInteger("FaceDirection");
if (animator.GetBool("MeleeAttackBool"))
{
animator.SetBool("MeleeAttackBool", false);
switch (currentDirection)
{
case Direction.Up:
animator.CrossFade("P_Idle_Up", 0.5f);
break;
case Direction.Down:
animator.CrossFade("P_Idle_Down", 0.5f);
break;
case Direction.Left:
animator.CrossFade("P_Idle_Left", 0.5f);
break;
case Direction.Right:
animator.CrossFade("P_Idle_Right", 0.5f);
break;
}
}
ResetAnimationState(animator);
}
示例6: OnStateEnter
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if(animator.GetInteger("direction") == 3)
{
animator.transform.Rotate (0, 180, 0);
}
}
示例7: GrabMethods
//called by lvl change
private void GrabMethods(){
background = GameObject.Find("Background");
//player = GameObject.Find("Player").GetComponent<PlayerController>();
scenery = background.GetComponent<Animator>();
sea = SeasonExtension.ToSeason(scenery.GetInteger("Season"));
targets = GetEffectedArray();
}
示例8: OnStateExit
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
//override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if(animator.GetInteger("canAttack") == 0){
wait (1.0f);
animator.gameObject.GetComponent<Enemy>().toggle_attack();
}
}
示例9: CheckDrop
/// <summary>
/// Check drop size (go away or detect)
/// </summary>
public static void CheckDrop(Animator animator, int sizeLimitDrop)
{
int size = animator.GetInteger("SizeDrop");
int sizeLimit = sizeLimitDrop;
if (sizeLimit > 0 && size >= sizeLimit) {
animator.SetBool("GoAway", true);
} else if ((sizeLimit <= 0 || size < sizeLimit) && size > 0) {
animator.SetBool("Detect", true);
}
}
示例10: Awake
void Awake()
{
_skills = new List<Skills>();
_utility = new List<Skills>();
god = GameObject.FindGameObjectWithTag("God").GetComponent<UnifiedSuperClass>();
skillsController = god.SkillsController;
anim = transform.parent.gameObject.GetComponent<Animator> ();
anim.SetInteger ("Skill", 1);
currentSkill = anim.GetInteger ("Skill");
}
示例11: OnStateEnter
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
controlArma =GameObject.Find ("Animacionwinchester_94_30-30").GetComponent<controlDeArmasJugador> ();
cartuchos = animator.GetInteger("cartuchos")+1;
animator.SetInteger ("cartuchos", cartuchos);
//controlArma.muestraMunicion ();
controlArma.municionActual++;
controlArma.dismiNuirParque ();
//controlArma.muestraMunicion ();
//controlArma.muestraMunicion ();
}
示例12: OnStateExit
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
//override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
//override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
animator.gameObject.GetComponent<PressStart>().mode = animator.GetInteger("mode");
poof = animator.gameObject.GetComponentsInChildren<ParticleSystem>();
foreach (var puff in poof)
{
Debug.Log("Puff");
puff.Play();
}
animator.SetBool("flipped", !animator.GetBool("flipped"));
//UnityEngine.EventSystems.EventSystem.current.SetSelectedGameObject (GameObject.FindGameObjectWithTag ("UI Element"));
//anim.SetInteger("mode", menuNumber);
}
示例13: OnStateEnter
//OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
casquillos = animator.GetInteger("casquillos")-1;
animator.SetInteger ("casquillos", casquillos);
cartucho6 = GameObject.Find ("/FPSController/FirstPersonCharacter/armas/animacionColt44-40/cartucho_006");
m =cartucho6.GetComponent<SkinnedMeshRenderer>();
m.enabled = false;
//cartucho6 = GameObject.Find ("/FPSController/FirstPersonCharacter/armas/animacionColt44-40/cartucho_006");
//cartucho6.GetComponent<Renderer>().enabled = true;
cartucho0 = GameObject.Find ("/FPSController/FirstPersonCharacter/armas/animacionColt44-40/cartucho_000");
m0 =cartucho0.GetComponent<SkinnedMeshRenderer>();
m0.enabled = true;
}
示例14: Awake
// Use this for initialization
void Awake()
{
buttonDown = false;
anim = transform.parent.gameObject.GetComponent<Animator> ();
anim.SetInteger ("Skill", 1);
currentSkill = anim.GetInteger ("Skill");
dashSkillLock = false;
spinSkillLock = false;
setDashDuration = dashDuration;
setSpinDuration = spinDuration;
holsterSword.SetActive(false);
shield.SetActive (false);
//linked = false;
}
示例15: OnStateEnter
// private AnotherScript anotherScript;
//private GameObject otherScript;
//OtherScript = GetComponent(OtherScript);
//public GameObject objectToAccess;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
casquillos = animator.GetInteger ("casquillos");
//GameObject Object1 = GameObject.Find ("armas");
//Component anotherScript = Object1.GetComponent<disparosDelJugador> ();
/*disparo = GameObject.Find ("armas").GetComponent<disparosDelJugador> ();
disparo.disparo ();*/
anim = GameObject.Find ("animacionColt44-40").GetComponent<Animator> ();
anim.SetInteger ("cartuchos",anim.GetInteger("cartuchos")-1);
}