예제 #1
0
        void Update()
        {
            if (TheGame.Get().IsPaused())
            {
                return;
            }

            //Anims
            animator.SetBool("Jumping", character.IsJumping());
            animator.SetBool("InAir", !character.IsGrounded());
            animator.SetBool("Crouching", character.IsCrouching());
            animator.SetFloat("Speed", character.GetMove().magnitude);
            animator.SetBool("Climb", character.IsClimbing());
            if (character_item != null)
            {
                animator.SetBool("Hold", character_item.GetHeldItem() != null);
            }

            //Hit flashing
            render.color = new Color(render.color.r, render.color.g, render.color.b, 1f);
            if (flash_fx_timer > 0f)
            {
                flash_fx_timer -= Time.deltaTime;
                float alpha = Mathf.Abs(Mathf.Sin(flash_fx_timer * Mathf.PI * 4f));
                render.color = new Color(render.color.r, render.color.g, render.color.b, alpha);
            }
        }
예제 #2
0
 public void OnClickSave()
 {
     if (TheGame.Get())
     {
         TheGame.Get().Save();
     }
 }
예제 #3
0
 public void Save()
 {
     PlayerData.Get().current_checkpoint = unique_id;
     TheGame.Get().Save();
 }
예제 #4
0
 private void Start()
 {
     TheGame.Get().onPause += (bool paused) => { animator.Rebind(); };
 }