Esempio n. 1
0
 public override void Execute(Statem statem)
 {
     if (statem.GetComponent <MenuAniCon> ().omt.ifTouch)
     {
         statem.GetComponent <MenuAniCon> ().ani.SetBool("ifOn", true);
         statem.ChangeState(new OpenState());
     }
 }
Esempio n. 2
0
 public override void Execute(Statem statem)
 {
     if (statem.GetComponent <MenuAnimatorContorler> ().omt.ifTouch)
     {
         statem.GetComponent <MenuAnimatorContorler> ().ani.SetBool("ifOn", false);
         statem.GetComponent <MenuAnimatorContorler> ().ani.SetBool("ifClose", true);
         statem.ChangeState(new CloseState());
     }
 }
Esempio n. 3
0
 public override void Execute(Statem statem)
 {
     if (statem.GetComponent <MenuAnimatorContorler> ().ani.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1)
     {
         print(0);
         statem.GetComponent <MenuAnimatorContorler> ().ani.SetBool("ifClose", false);
         statem.GetComponent <MenuAnimatorContorler> ().ani.SetBool("ifOff", true);
         statem.ChangeState(new OffState());
     }
 }
Esempio n. 4
0
 public override void Execute(Statem statem)
 {
     if (statem.gameObject.transform.position.x > 6.5f && statem.GetComponent <ItemCommon> ().ifClick == true)
     {
         statem.ChangeState(new UnUseState());
     }
     else if (statem.GetComponent <ItemCommon> ().ifClick == false)
     {
         statem.gameObject.transform.position = new Vector3(statem.GetComponent <ItemCommon> ().myX, statem.GetComponent <ItemCommon> ().myY, -1);
     }
 }
        public override void Execute(Statem statem)
        {
            //加速 保持速度
            if (statem.GetComponent <CharacterControl> ().ShouldAccelerate())
            {
                statem.GetComponent <CharacterControl>().Accelerate();
            }

            //静止 切换状态
            else if (statem.GetComponent <CharacterControl> ().ShouldActStay())
            {
                /*if (statem.GetComponent<CharacterControl> ().pSystem != null) {
                 *      statem.GetComponent<CharacterControl> ().pSystem.Play ();
                 * }*/
                statem.ChangeState(new Stay());
            }

            //限制速度
            else if (statem.GetComponent <CharacterControl> ().ShouldMaintain())
            {
            }
            //转向
            if (statem.GetComponent <CharacterControl> ().ShouldTurnLeft())
            {
                statem.GetComponent <CharacterControl>().TrunLeft();
            }
            else if (statem.GetComponent <CharacterControl> ().ShouldTurnRight())
            {
                statem.GetComponent <CharacterControl>().TurnRight();
            }
        }
 public override void Execute(Statem statem)
 {
     if (statem.GetComponent <CharacterControl> ().moveDir != 0)
     {
         statem.ChangeState(new Move());
     }
 }
Esempio n. 7
0
 public override void Execute(Statem statem)
 {
     if (statem.GetComponent <ItemCommon> ().ifClick == false && statem.gameObject.transform.position.x > 6.5f && statem.gameObject.transform.position.x < 9.5f && statem.gameObject.transform.position.y < 5.3f && statem.gameObject.transform.position.y > -1.3f)
     {
         statem.GetComponent <ItemCommon> ().myX = statem.gameObject.transform.position.x;
         statem.GetComponent <ItemCommon> ().myY = statem.gameObject.transform.position.y;
     }
     if (statem.GetComponent <ItemCommon>().ifClick == false && statem.GetComponent <ItemCommon>().ifUse == false && (statem.gameObject.transform.position.x < 6.5f || statem.gameObject.transform.position.x > 9.6f || statem.gameObject.transform.position.y < -1.3f || statem.gameObject.transform.position.y > 5.3f))
     {
         statem.gameObject.transform.position = new Vector3(statem.GetComponent <ItemCommon>().myX, statem.GetComponent <ItemCommon>().myY, -1);
     }
 }
Esempio n. 8
0
        public override void Execute(Statem statem)
        {
            if (statem.GetComponent <LittleGirlAniCon> ().ani.GetCurrentAnimatorStateInfo(0).normalizedTime >= 0.9f && statem.GetComponent <LittleGirlAniCon> ().ani.GetFloat("speed") == 1f)
            {
                statem.GetComponent <LittleGirlAniCon> ().ani.SetFloat("speed", -1f);
            }

            if (statem.GetComponent <LittleGirlAniCon> ().ani.GetCurrentAnimatorStateInfo(0).normalizedTime <= 0.1f && statem.GetComponent <LittleGirlAniCon> ().ani.GetFloat("speed") == -1f)
            {
                statem.GetComponent <LittleGirlAniCon> ().ani.SetFloat("speed", 1f);
            }

            if (statem.GetComponent <LittleGirlAniCon>().isChange)
            {
                statem.GetComponent <LittleGirlAniCon>().ani.SetBool("isChange", true);
                statem.ChangeState(new OnState());
            }
        }
Esempio n. 9
0
        public override void Execute(Statem statem)
        {
            if (statem.GetComponent <LittleGirlAniCon>().ani.GetCurrentAnimatorClipInfo(0)[0].clip.name == statem.GetComponent <LittleGirlAniCon>().name)
            {
                if (statem.GetComponent <LittleGirlAniCon> ().ani.GetCurrentAnimatorStateInfo(0).normalizedTime >= 0.9f && statem.GetComponent <LittleGirlAniCon> ().ani.GetFloat("speed") == 1f)
                {
                    statem.GetComponent <LittleGirlAniCon> ().ani.SetFloat("speed", 0f);
                }

                if (statem.GetComponent <LittleGirlAniCon> ().i < statem.GetComponent <LittleGirlAniCon> ().winkTime&& statem.GetComponent <LittleGirlAniCon> ().ani.GetFloat("speed") == 0f)
                {
                    statem.GetComponent <LittleGirlAniCon> ().i++;
                }
                if (statem.GetComponent <LittleGirlAniCon> ().i >= statem.GetComponent <LittleGirlAniCon> ().winkTime&& statem.GetComponent <LittleGirlAniCon> ().ani.GetFloat("speed") == 0f)
                {
                    statem.GetComponent <LittleGirlAniCon> ().i = 0;
                    statem.GetComponent <LittleGirlAniCon> ().ani.SetFloat("speed", -1f);
                }


                if (statem.GetComponent <LittleGirlAniCon> ().ani.GetCurrentAnimatorStateInfo(0).normalizedTime <= 0.05f && statem.GetComponent <LittleGirlAniCon> ().ani.GetFloat("speed") == -1f)
                {
                    statem.GetComponent <LittleGirlAniCon> ().ani.SetFloat("speed", 1f);
                }
            }
        }
Esempio n. 10
0
 public override void Exit(Statem statem)
 {
     statem.GetComponent <LittleGirlAniCon> ().ani.SetFloat("speed", 1f);
 }
Esempio n. 11
0
 public override void Exit(Statem statem)
 {
     statem.GetComponent <MenuAnimatorContorler> ().audioController.SetActive(false);
     statem.GetComponent <MenuAnimatorContorler> ().exit.SetActive(false);
 }
Esempio n. 12
0
 public override void Enter(Statem statem)
 {
     statem.GetComponent <CharacterControl> ().animator.Play("stay");
 }
Esempio n. 13
0
 public override void Execute(Statem statem)
 {
     if (statem.GetComponent <MenuAniCon> ().ani.GetCurrentAnimatorClipInfo(0)[0].clip.name == "openmenu")
     {
         if (statem.GetComponent <MenuAniCon> ().omt.ifTouch&&statem.GetComponent <MenuAniCon> ().ani.GetFloat("speed") == 1f)
         {
             statem.GetComponent <MenuAniCon> ().ani.SetFloat("speed", -1f);
         }
         if (statem.GetComponent <MenuAniCon> ().omt.ifTouch&&statem.GetComponent <MenuAniCon> ().ani.GetFloat("speed") == 0)
         {
             statem.GetComponent <MenuAniCon> ().ani.SetFloat("speed", -1f);
             statem.GetComponent <MenuAniCon> ().audioController.SetActive(false);
             statem.GetComponent <MenuAniCon> ().exit.SetActive(false);
         }
         if (statem.GetComponent <MenuAniCon> ().ani.GetCurrentAnimatorStateInfo(0).normalizedTime >= 0.9f && statem.GetComponent <MenuAniCon> ().ani.GetFloat("speed") == 1f)
         {
             statem.GetComponent <MenuAniCon> ().ani.SetFloat("speed", 0);
             statem.GetComponent <MenuAniCon> ().audioController.SetActive(true);
             statem.GetComponent <MenuAniCon> ().exit.SetActive(true);
         }
         if (statem.GetComponent <MenuAniCon> ().ani.GetCurrentAnimatorStateInfo(0).normalizedTime <= 0.1f && statem.GetComponent <MenuAniCon> ().ani.GetFloat("speed") == -1f)
         {
             statem.GetComponent <MenuAniCon> ().ani.SetBool("ifOn", false);
             statem.ChangeState(new OffState());
         }
     }
 }
Esempio n. 14
0
 public override void Enter(Statem statem)
 {
     statem.GetComponent <MenuAniCon> ().ani.SetFloat("speed", 1f);
 }