コード例 #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
ファイル: addWheels.cs プロジェクト: PicQue/QuadFame
 private void OnTriggerStay(Collider other)
 {
     if (other.tag == "Player")
     {
         objectLocation pOL = other.GetComponent <objectLocation>();
         if (pOL.sendTag() == "tire")
         {
             pOL.giveObject(gameObject);
         }
     }
 }
コード例 #3
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 (pOL.sendTag() == "paint")
             {
                 mt.color      = omt.color;
                 sendcondition = true;
             }
         }
     }
 }