// Update is called once per frame void Update() { if (gc != null && !gc.gameOver && gc.isRun) { if (!runCoroutine) { PlayerInput(); } if (stan) { if (isGround) { stanRelease += Time.deltaTime; } if (stanRelease >= 10 || leverCount == leverMax) { stan = false; notMove = false; stanRelease = 0; leverCount = 0; transform.parent = null; gameObject.GetComponent <Rigidbody>().isKinematic = false; _animator.SetBool("Fell", false); _animator.SetBool("Hold", false); _animator.SetBool("GraveCatched", false); } } if (otherPlayer != null || throwObject != null) { ThrowFailed(); } if (recovery) { _invincible += Time.deltaTime; Color face = _faceMaterial.color; Color body = _bodyMaterial.color; if (face.a >= 1 || face.a <= 0) { _alpha *= -1; } face.a += _alpha; body.a += _alpha; _faceMaterial.color = face; _bodyMaterial.color = body; if (_invincible >= invisible) { recovery = false; _invincible = 0; MaterialUtils.SetMode(_faceMaterial, MaterialUtils.Mode.Opaque); MaterialUtils.SetMode(_bodyMaterial, MaterialUtils.Mode.Opaque); _faceMaterial.color = new Color(_faceMaterial.color.r, _faceMaterial.color.g, _faceMaterial.color.b, 1); _bodyMaterial.color = new Color(_bodyMaterial.color.r, _bodyMaterial.color.g, _bodyMaterial.color.b, 1); } } } }
public void Resusitation() { if (throwObject != null) { throwObject.GetComponent <Rigidbody>().isKinematic = false; throwObject.transform.parent = null; throwObject = null; _animator.SetBool("Throw", false); _animator.SetBool("Catch", false); _animator.SetBool("CatchPlayer", false); _animator.SetFloat("CatchDelay", 0); ThrowFailed(); } gameObject.AddComponent <NomalizeState>(); _animator.SetBool("Fell", false); _animator.SetBool("Hold", false); stan = false; MaterialUtils.SetMode(_faceMaterial, MaterialUtils.Mode.Fade); MaterialUtils.SetMode(_bodyMaterial, MaterialUtils.Mode.Fade); Debug.Log(_faceMaterial.GetFloat("_Mode")); recovery = true; _plusPoint -= 50; PointUpdate(); }