private void Completed() { if (state) { _animationDelayCreator.Delay(_animation.PlayBackwards, totalTime / levelMultiplier / 2); } else { _animationDelayCreator.Delay(_animation.PlayForward, totalTime / levelMultiplier); } state = !state; }
public void Die() { _animator.enabled = false; ActivateRigidBodies(true); this.GetComponent <Rigidbody>().isKinematic = true; ActivateColliders(true); this.GetComponent <Collider>().enabled = false; if (!isAI) { _delayGenerator.Delay(controller.CheckForRemainingLife, reSpawnTime); } else { _delayGenerator.Delay(ReSpawnAI, reSpawnTime); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("InGameObject")) { hitCollider = other.gameObject; if (other.attachedRigidbody != null) { other.attachedRigidbody.transform.parent.GetComponent <InGameObject>().makeAction(this); if (!isAI) { controller.SetCameraTarget(other.transform); } } else { other.transform.parent.GetComponent <InGameObject>().makeAction(this); if (!isAI) { controller.SetCameraTarget(other.transform); } } if (!isAI) { if (hitCollider.GetComponent <MeshRenderer>() != null && hitCollider.GetComponent <MeshRenderer>().material.HasProperty("Boolean_DDA422C6")) { Material effectMat = hitCollider.GetComponent <MeshRenderer>().material; effectMat.SetFloat("Boolean_DDA422C6", 1); _effectedMaterials.Add(effectMat); _materialDelay.Delay(SetMaterialToNormal, reSpawnTime); } } } else if (other.CompareTag("reSpawnPoint")) { respawnPoint = other.transform; } else if (other.CompareTag("end")) { Stop(); isActive = false; if (!isAI) { controller.EndLevel(); } } }
public override void makeAction(Racer racer) { racer.GetComponent <Animator>().SetTrigger("Fall"); racer.GetComponent <Animator>().applyRootMotion = false; _fallDelayCreator.Delay(racer.Die, fallTime); }
private void Awake() { _animationDelayCreator = new DelayFunction(); _fallDelayCreator = new DelayFunction(); _animationDelayCreator.Delay(StartMoving, UnityEngine.Random.Range(0, variationTimer)); }
private void Start() { variationDelay = new DelayFunction(); variationDelay.Delay(StartMove, Random.Range(0, variationTimer)); }