예제 #1
0
    private void OnCollisionStay(Collision collision)
    {
        if (collision.transform.tag == "Player")
        {
            objectLocation pOL = collision.transform.GetComponent <objectLocation>();
            if (Input.GetKeyDown(kc[index[collision.transform.GetComponent <UserMovement>().charIndexNumber]]))
            {
                if (oilNumber == 1)
                {
                    if (pOL.sendTag() == "orangeOil")
                    {
                        g_Three = Instantiate(gThree, new Vector3(transform.position.x, 8, transform.position.z), Quaternion.identity);
                        oilChangeIcon.SetActive(false);
                        g_Three.GetComponent <gameThree>().pName    = collision.transform.name;
                        g_Three.GetComponent <gameThree>().summoner = gameObject;
                        Destroy(collision.transform.Find(pOL.sendTag()), 5);
                    }
                }

                if (oilNumber == 2)
                {
                    if (pOL.sendTag() == "blackOil")
                    {
                        g_Three = Instantiate(gThree, new Vector3(transform.position.x, transform.position.y + 4, transform.position.z), Quaternion.identity);
                        oilChangeIcon2.SetActive(false);
                        g_Three.GetComponent <gameThree>().pName    = collision.transform.name;
                        g_Three.GetComponent <gameThree>().summoner = gameObject;
                        Destroy(collision.transform.Find(pOL.sendTag()), 5);
                    }
                }
            }
        }
    }
예제 #2
0
파일: carWash.cs 프로젝트: PicQue/QuadFame
 private void OnCollisionStay(Collision collision)
 {
     if (collision.transform.tag == "Player")
     {
         objectLocation pOL = collision.transform.GetComponent <objectLocation>();
         if (Input.GetKeyDown(kc[index[collision.transform.GetComponent <UserMovement>().charIndexNumber]]))
         {
             sendcondition = true;
         }
     }
 }
예제 #3
0
 private void OnTriggerStay(Collider other)
 {
     if (other.tag == "Player")
     {
         objectLocation pOL = other.GetComponent <objectLocation>();
         if (pOL.sendTag() == "tire")
         {
             pOL.giveObject(gameObject);
         }
     }
 }
예제 #4
0
 private void OnCollisionStay(Collision collision)
 {
     if (collision.transform.tag == "Player")
     {
         objectLocation pOL = collision.transform.GetComponent <objectLocation>();
         if (Input.GetKeyDown(kc[index[collision.transform.GetComponent <UserMovement>().charIndexNumber]]))
         {
             g_Three = Instantiate(gThree, new Vector3(transform.position.x, -23, transform.position.z), Quaternion.identity);
             oilChangeIcon.SetActive(false);
             g_Three.GetComponent <gameFour>().pName    = collision.transform.name;
             g_Three.GetComponent <gameFour>().summoner = gameObject;
         }
     }
 }