예제 #1
0
 private void OnCollisionEnter(Collision other)
 {
     onStayTimer = 0;
     if (other.gameObject.CompareTag("Wall"))
     {
         random_rot = Random.Range(135f, 225f);
         cmp_rot.InstantRotation(0, random_rot, 0, Space.Self);
     }
     if (other.gameObject.CompareTag("Rhino"))
     {
         random_rot = Random.Range(135f, 225f);
         cmp_rot.InstantRotation(0, random_rot, 0, Space.Self);
     }
     if (other.gameObject.CompareTag("Boss"))
     {
         random_rot = Random.Range(135f, 225f);
         cmp_rot.InstantRotation(0, random_rot, 0, Space.Self);
     }
     if (other.gameObject.CompareTag("Player"))
     {
         if (GameObject.Find("Player").GetComponent <PlayerController>().inmune == false)
         {
             other.gameObject.GetComponent <PlayerController>().DamageItself(1);
             //Physics.IgnoreCollision(other.gameObject.GetComponent<Collider>(), gameObject.GetComponent<Collider>(), true);
         }
         //random_rot = Random.Range(135f, 225f);
         //cmp_rot.InstantRotation(0, random_rot, 0, Space.Self);
     }
     if (other.gameObject.CompareTag("Enemy"))
     {
         random_rot = Random.Range(135f, 225f);
         cmp_rot.InstantRotation(0, random_rot, 0, Space.Self);
     }
 }
예제 #2
0
 private void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.CompareTag("Wall"))
     {
         random_rot = Random.Range(135f, 225f);
         cmp_rot.InstantRotation(0, random_rot, 0, Space.Self);
     }
     if (other.gameObject.CompareTag("Rhino"))
     {
         random_rot = Random.Range(135f, 225f);
         cmp_rot.InstantRotation(0, random_rot, 0, Space.Self);
     }
     if (other.gameObject.CompareTag("Player"))
     {
         if (GameObject.Find("Player").GetComponent <PlayerController>().inmune == false)
         {
             other.gameObject.GetComponent <PlayerController>().DamageItself(1);
         }
         random_rot = Random.Range(135f, 225f);
         cmp_rot.InstantRotation(0, random_rot, 0, Space.Self);
     }
     if (other.gameObject.CompareTag("Enemy"))
     {
         random_rot = Random.Range(135f, 225f);
         cmp_rot.InstantRotation(0, random_rot, 0, Space.Self);
     }
 }
예제 #3
0
    public void Proyectile()
    {
        timer += Time.deltaTime;

        if (timer >= time_to_up && to_down == false)
        {
            transform.position = new Vector3(GameObject.Find("Player").transform.position.x, transform.position.y, GameObject.Find("Player").transform.position.z);
            cmp_rot.InstantRotation(180, 0, 0, Space.World);
            cmp_mov.Move_in_Y(up_spd * 0.7f, -1);
            to_down = true;
        }
        else if (timer < time_to_up)
        {
            cmp_mov.Move_in_Y(up_spd, 1);
        }
    }
예제 #4
0
 private void OnEnable()
 {
     to_down = false;
     timer   = 0;
     cmp_rot.InstantRotation(180, 0, 0, Space.World);
 }