コード例 #1
0
    public void Jump(bool superJump)
    {
        if (this.m_NoJump)
        {
            return;
        }
        bool flag = false;

        if (this.m_NavMeshAgent != null)
        {
            this.m_NavMeshAgent.enabled   = false;
            this.m_PlayerMotor.enabled    = true;
            this.m_PlayerMotor.m_NavAgent = false;
        }
        if (superJump)
        {
            this.m_PlayerMotor.jumpHeight = 5f;
            this.m_PlayerMotor.gravity    = 15f;
            GameObject gameObject = EffectGenerator.CreateEffectGameObject("ep02_jump_01");
            if (gameObject != null)
            {
                Transform transform = TransformTool.SearchHierarchyForBone(base.transform, "Bip001 Footsteps");
                if (transform != null)
                {
                    gameObject.transform.position = transform.position;
                    gameObject.transform.parent   = transform;
                }
                UnityEngine.Object.DestroyObject(gameObject, 3f);
            }
            this.m_JumpMotor.IsSuperJump = true;
            this.m_PlayerMotor.Jump();
            return;
        }
        bool flag2 = false;

        if (!this.m_LockControl && !this.m_EnterTalk && !flag)
        {
            flag2 = true;
        }
        if (GameInput.GetJoyKeyDown(JOYSTICK_KEY.Y))
        {
            flag2 = true;
        }
        if (flag2)
        {
            this.m_PlayerMotor.jumpHeight = this.m_JumpHeight;
            this.m_PlayerMotor.gravity    = this.m_JumpGravity;
            this.m_JumpMotor.IsSuperJump  = false;
            this.m_PlayerMotor.Jump();
        }
    }
コード例 #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Npc")
     {
         this.m_EnterTalk = true;
     }
     if (other.tag == "MusicEvent")
     {
         other.gameObject.SendMessage("OnTalk", SendMessageOptions.DontRequireReceiver);
         if (Swd6Application.instance.m_ResourceType == ENUM_ResourceType.Develop)
         {
             Debug.Log("執行切換音樂事件_" + other.name);
         }
     }
     if (other.tag == "Event")
     {
         this.m_EnterTalkEvent = true;
         if (Swd6Application.instance.gameStateService.getCurrentState().name == "GameMenuState")
         {
             Swd6Application.instance.PopState();
         }
         if (base.MoveRole)
         {
             return;
         }
         other.gameObject.SendMessage("OnTalk", SendMessageOptions.DontRequireReceiver);
         if (Swd6Application.instance.m_ResourceType == ENUM_ResourceType.Develop)
         {
             Debug.Log("執行事件_" + other.name);
         }
     }
     if (other.tag == "BattleEvent")
     {
         Swd6Application.instance.m_ExploreSystem.SetBattleAreaState(other.name);
     }
     if (other.tag == "WaterEvent" || other.tag == "WaterEvent2")
     {
         if (!this.m_WalkInWater)
         {
             string name;
             if (other.tag == "WaterEvent")
             {
                 name = "footstep_Water1";
                 this.m_FootStepWaterName = "footstep_Water2";
             }
             else
             {
                 name = "footstep_Blood1";
                 this.m_FootStepWaterName = "footstep_Blood2";
             }
             if (this.IsJumpOver())
             {
                 int num = 256;
                 num = ~num;
                 RaycastHit raycastHit = default(RaycastHit);
                 if (Physics.Raycast(new Ray
                 {
                     origin = base.gameObject.transform.position + new Vector3(0f, 1f, 0f),
                     direction = new Vector3(0f, -1f, 0f)
                 }, out raycastHit, 1000f, num))
                 {
                     GameObject gameObject = EffectGenerator.CreateEffectGameObject(name);
                     if (gameObject != null)
                     {
                         gameObject.transform.position = raycastHit.point;
                     }
                     gameObject = EffectGenerator.CreateEffectGameObject(this.m_FootStepWaterName);
                     if (gameObject != null)
                     {
                         gameObject.transform.position = raycastHit.point;
                     }
                 }
                 MusicControlSystem.PlaySound(3662, 1);
             }
         }
         this.m_WalkInWater = true;
     }
 }