private void OnTriggerExit(Collider other) { if (other.CompareTag("WhirlwindVacuumColl")) { if (_state != CubeStates.Rise) { _state = CubeStates.Stay; } } }
private void OnTriggerExit(Collider other) { if (other.CompareTag("TornadoVacuumCollider")) { if (_currentState != CubeStates.RISE) { _currentState = CubeStates.HOLD; } } }
public void DeadCube() { if (State == CubeStates.CsDying) { return; } State = CubeStates.CsDying; _posZ = 0; _veloZ = -10f; }
public void WinningCube() { if (State == CubeStates.CsWon) { return; } State = CubeStates.CsWinning; _posZ = 0; _veloZ = +10f; }
private void OnTriggerStay(Collider other) { if (other.CompareTag("TornadoVacuumCollider")) { if (_currentState != CubeStates.RISE) { _currentState = CubeStates.VACUUM; Vector3 dir = (other.GetComponent <TornadoVacuumCollController> ().tornadoCenter.position - transform.position).normalized; _cubeRB.AddForce(dir * vacuumSpeed * Time.deltaTime); } } }
private void OnTriggerStay(Collider other) { if (other.CompareTag("WhirlwindVacuumColl")) { if (_state != CubeStates.Rise) { _state = CubeStates.Vacuum; transform.Rotate(new Vector3(0f, (_risingRotationSpeed / 2f) * Time.deltaTime, (_risingRotationSpeed / 2f) * Time.deltaTime), Space.Self); Vector3 _vector = (other.GetComponent <VacuumCollider>().centerTransform.position - transform.position).normalized; _rigidBodyCube.AddForce(_vector * _vacuumSpeed * Time.deltaTime); } } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("TornadoInnerTrigger")) { if (_currentState != CubeStates.RISE) { _currentState = CubeStates.RISE; transform.parent = other.transform; _cubeRB.useGravity = false; TriggerShrink(); } } }
private void WinningAnimation() { if (State != CubeStates.CsWinning) { return; } if (_curBright > 0.0f) { _posZ += _veloZ * (float)Time.Instance.DeltaTime; _curBright -= 3f * (float)Time.Instance.DeltaTime; } else { State = CubeStates.CsWon; } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("WhirlwindCenterTrigger")) { if (_state != CubeStates.Rise) { _state = CubeStates.Rise; transform.parent = other.transform; _rigidBodyCube.isKinematic = true; transform.DOScale(0.03f, _shrinkSpeed).SetDelay(0.1f).OnComplete(() => { Destroy(gameObject); AudioController.audioController.PlayGetPointSFX(); }); } } }
public void TriggerCollected() { if (cubeState == CubeStates.OnHold) { AudioManager._instance.PlayCubeCollectSFX(); cubeState = CubeStates.InParent; Destroy(backCheckCollObject); if (DOTween.IsTweening("CollectibleNormalCubeScaleTween")) { DOTween.Kill("CollectibleNormalCubeScaleTween"); } transform.localScale = defScale; Destroy(GetComponent <CollectableVacuumModule>()); } } // TriggerCollected()
private void DeadAnimation() { if (State != CubeStates.CsDying) { return; } _cubeMoveSound.Stop(); if (_curBright > 0.0f) { _posZ += _veloZ * (float)Time.Instance.DeltaTime; _curBright -= 3f * (float)Time.Instance.DeltaTime; } else { State = CubeStates.CsDead; } }
// methods public void ResetCube(int x, int y) { State = CubeStates.CsLoading; PosCurXY[0] = x; PosCurXY[1] = y; for (var i = 0; i < 1; i++) { _rotateYX[i] = 0.0f; _curDirXY[i] = 0; } _orientQuat = Quaternion.Identity; _posZ = 2; _veloZ = 0.0f; _curBright = 0.0f; }
private void LoadAnimation() { if (State != CubeStates.CsLoading) { return; } _veloZ = Math.Min(-0.6f, -_posZ / 0.17f); _posZ += _veloZ * (float)Time.Instance.DeltaTime; _curBright = 1 - (_posZ / 2); if (_posZ < 0.01f) { _posZ = 0; _veloZ = 0; _curBright = 1.0f; State = CubeStates.CsAlive; } }
private void LoadAnimation() { if (State != CubeStates.CsLoading) return; _veloZ = Math.Min(-0.6f, -_posZ/0.17f); _posZ += _veloZ*(float) Time.Instance.DeltaTime; _curBright = 1 - (_posZ/2); if (_posZ < 0.01f) { _posZ = 0; _veloZ = 0; _curBright = 1.0f; State = CubeStates.CsAlive; } }
public void DeadCube() { if (State == CubeStates.CsDying) return; State = CubeStates.CsDying; _posZ = 0; _veloZ = -10f; }
private void WinningAnimation() { if (State != CubeStates.CsWinning) return; if (_curBright > 0.0f) { _posZ += _veloZ*(float) Time.Instance.DeltaTime; _curBright -= 3f*(float) Time.Instance.DeltaTime; } else State = CubeStates.CsWon; }
private void DeadAnimation() { if (State != CubeStates.CsDying) return; _cubeMoveSound.Stop(); if (_curBright > 0.0f) { _posZ += _veloZ*(float) Time.Instance.DeltaTime; _curBright -= 3f*(float) Time.Instance.DeltaTime; } else State = CubeStates.CsDead; }
public void WinningCube() { if (State == CubeStates.CsWon) return; State = CubeStates.CsWinning; _posZ = 0; _veloZ = +10f; }