Ejemplo n.º 1
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.relativeVelocity.magnitude > 1.0f)
     {
         GetComponent <GenerateView>().GetCurrentView().GetComponent <HookeScale>().Perturb();
         ScreenShakeManager.Perturb();
         ParticleSystemManager.RequestParticlesAtPositionAndDirection(collision.contacts[0].point, collision.contacts[0].normal);
     }
 }
Ejemplo n.º 2
0
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.tag == "Player")
        {
            ScreenShakeManager.Perturb();
            fireHook.caughtplayer = collision.collider.gameObject.transform.parent.transform;

            collision.collider.gameObject.transform.parent.transform.SetParent(hook);
            collision.collider.gameObject.GetComponent <CapsuleController>().isAbleToMove = false;

            playerMovement     = collision.collider.gameObject;
            fireHook.ishooking = false;
            fireHook.isstop    = false;
        }
    }
Ejemplo n.º 3
0
 public void OnCollisionEnter(Collision collision)
 {
     if (collision.collider.tag == "Fist" && collision.collider.GetComponentInParent <PlayerPunch>().isPunch&& !isHit) // 1. Tag 2. 确实有出拳 3. invincible
     {
         ScreenShakeManager.Perturb();
         isHit = true;
         StartCoroutine(GetHitChangeColor());
         health -= 10;
         healthBar.fillAmount = health / 50f;
         if (health == 0 && !isExploded)
         {
             Explode(); isExploded = true; Destroy(this.transform.parent.gameObject);
         }
     }
 }
Ejemplo n.º 4
0
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.tag == "Player")
        {
            ScreenShakeManager.Perturb();
            fireHook.caughtplayer = collision.collider.gameObject.transform.parent.transform;

            collision.collider.gameObject.transform.parent.GetChild(0).gameObject.SetActive(true);
            collision.collider.gameObject.transform.parent.transform.SetParent(hook);
            collision.collider.gameObject.GetComponent <CapsuleController>().isableMove  = false;
            collision.collider.gameObject.GetComponent <PlayerPunch>().isablePunch       = false;
            collision.collider.gameObject.GetComponent <LayDownHook>().isableLayDownHook = false;

            playerMovement     = collision.collider.gameObject;
            fireHook.ishooking = false;
            fireHook.isstop    = false;
        }
    }