Esempio n. 1
0
    private void Completed()
    {
        if (state)
        {
            _animationDelayCreator.Delay(_animation.PlayBackwards, totalTime / levelMultiplier / 2);
        }
        else
        {
            _animationDelayCreator.Delay(_animation.PlayForward, totalTime / levelMultiplier);
        }

        state = !state;
    }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
    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();
            }
        }
    }
Esempio n. 4
0
 public override void makeAction(Racer racer)
 {
     racer.GetComponent <Animator>().SetTrigger("Fall");
     racer.GetComponent <Animator>().applyRootMotion = false;
     _fallDelayCreator.Delay(racer.Die, fallTime);
 }
Esempio n. 5
0
 private void Awake()
 {
     _animationDelayCreator = new DelayFunction();
     _fallDelayCreator      = new DelayFunction();
     _animationDelayCreator.Delay(StartMoving, UnityEngine.Random.Range(0, variationTimer));
 }
Esempio n. 6
0
 private void Start()
 {
     variationDelay = new DelayFunction();
     variationDelay.Delay(StartMove, Random.Range(0, variationTimer));
 }