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


C# Animator.GetInteger方法代码示例

本文整理汇总了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";

            }
        }
    }
开发者ID:oonyeje,项目名称:BendingTempleAssets,代码行数:28,代码来源:EarthAttack.cs

示例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);
     }
 }
开发者ID:newhandfun,项目名称:WOBAgithub,代码行数:8,代码来源:SetFigureState.cs

示例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*/
    }
开发者ID:JonaSilva,项目名称:prueba,代码行数:35,代码来源:disparoColt44.cs

示例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);
 }
开发者ID:Baensi,项目名称:Assets,代码行数:8,代码来源:AttackNextStage.cs

示例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);
    }
开发者ID:musicm122,项目名称:The-Depths-of-H-E-double-hockey-stick,代码行数:33,代码来源:TurnOffAttack.cs

示例6: OnStateEnter

 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if(animator.GetInteger("direction") == 3)
     {
         animator.transform.Rotate (0, 180, 0);
     }
 }
开发者ID:roroque,项目名称:BigChallenge,代码行数:7,代码来源:deathrotate.cs

示例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();
	}
开发者ID:fondreak,项目名称:FailSeason,代码行数:8,代码来源:GameController.cs

示例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();
     }
 }
开发者ID:oonyeje,项目名称:BendingTempleAssets,代码行数:12,代码来源:EnemyAttack.cs

示例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);
     }
 }
开发者ID:MaturuturuStudios,项目名称:Drop,代码行数:13,代码来源:AIMethods.cs

示例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");
    }
开发者ID:MChen7209,项目名称:Yi-Ju-Chen,代码行数:11,代码来源:AttackController.cs

示例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 ();
	}
开发者ID:JonaSilva,项目名称:cozcyt,代码行数:12,代码来源:introducirCartuchosWinchester.cs

示例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);
    }
开发者ID:MMEstrada,项目名称:GoGoGrandmas,代码行数:23,代码来源:MenuModeChanger.cs

示例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;
 }
开发者ID:JonaSilva,项目名称:prueba,代码行数:14,代码来源:extraerCartuchos.cs

示例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;
 }
开发者ID:MChen7209,项目名称:Yi-Ju-Chen,代码行数:15,代码来源:WarriorAttack.cs

示例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);




	}
开发者ID:JonaSilva,项目名称:cozcyt,代码行数:20,代码来源:vaciarCartucho.cs


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