コード例 #1
0
ファイル: ObjSaver.cs プロジェクト: icynare/ModelEditor
 public void SetArg(PARTS pt, float thi, float ang, float wid)
 {
     parts = pt;
     thick = thi;
     angle = ang;
     width = wid;
 }
コード例 #2
0
    public void SetupPart3()
    {
        currentPart = PARTS.PART3;

        Camera.main.transform.position = new Vector3(conveyor_Part3.transform.position.x, .8f, -1.6f);
        Camera.main.transform.rotation = Quaternion.Euler(2f, 0, 0);

        conveyor_Part3.GetComponent <Animator>().SetBool("isMoving", true);

        shelves.SetActive(true);
        petri.SetActive(false);
        petri.transform.GetChild(0).GetComponent <PillSpawner>().enabled = false;

        foreach (GameObject pill in pills)
        {
            pill.GetComponent <Rigidbody>().isKinematic = true;
        }

        for (int i = 3 * currentTripletIndex; i < bottleSpawned_Count; i++)
        {
            bottles[i].GetComponent <BottleDragDrop>().enabled = true;
            // ui varsa silinir
            foreach (Transform child in bottles[i].transform)
            {
                if (child.GetComponent <Canvas>() != null)
                {
                    Destroy(child.gameObject);
                }
            }

            StartCoroutine(MoveBottles(bottles[i], conveyor_Part3, i));
        }
    }
コード例 #3
0
ファイル: ModelWindow.cs プロジェクト: icynare/ModelEditor
    private void SetNewParts(GameObject obj, PARTS part)
    {
        for (int i = obj.transform.childCount - 1; i >= 0; i--)
        {
            DestroyImmediate(obj.transform.GetChild(i).gameObject);
        }
        GameObject template  = Instantiate(obj);
        GameObject emptyTemp = Resources.Load <GameObject>("Models/Empty");

        int[] arrs = { 0, 1, 2, 3, 5 };
        int   tempP;

        tempP = arrs[(int)part];
        for (int i = 0; i < tempP; i++)
        {
            GameObject newpart = Instantiate(template);
            GameObject empty   = Instantiate(emptyTemp);
            empty.transform.SetParent(parentObj.transform);
            newpart.transform.SetParent(empty.transform);
            if (obj.tag == "Sector")
            {
                newpart.transform.localRotation = Quaternion.Euler(0, (360 / (tempP + 1)) * (i + 1), 0);
            }
            else
            {
                newpart.transform.RotateAround(pillar.position, Vector3.up, (360 / (tempP + 1)) * (i + 1));
            }
            empty.transform.SetParent(obj.transform);
        }

        DestroyImmediate(template);
    }
コード例 #4
0
ファイル: ObjSaver.cs プロジェクト: icynare/ModelEditor
 public ModelData(ModelType mType, PARTS pt, float thi, float ang, float wid)
 {
     modelType = mType;
     parts     = pt;
     thick     = thi;
     angle     = ang;
     width     = wid;
 }
コード例 #5
0
    public void SetupPart1()
    {
        currentPart = PARTS.PART1;

        // Kamera
        Camera.main.transform.position = new Vector3(conveyor_Part1.transform.position.x, Camera.main.transform.position.y, Camera.main.transform.position.z);

        conveyor_Part1.GetComponent <Animator>().SetBool("isMoving", true); // Conveyor animasyonunu başlatmak için

        shelves.SetActive(false);
        petri.SetActive(false);

        //Bottles
        StartCoroutine(SpawnBottles());

        //Labels
        SetupLabels();
    }
コード例 #6
0
    public void SetupPart2()
    {
        currentPart = PARTS.PART2;

        Camera.main.transform.position = new Vector3(conveyor_Part2.transform.position.x, Camera.main.transform.position.y, Camera.main.transform.position.z);

        labelPanel.SetActive(false);
        petri.SetActive(true);

        conveyor_Part2.GetComponent <Animator>().SetBool("isMoving", true);
        for (int i = 3 * currentTripletIndex; i < bottleSpawned_Count; i++)
        {   // Kapağı aç
            bottles[i].transform.GetChild(0).gameObject.SetActive(false);
            // Şişeleri yerlerine ilerlet
            StartCoroutine(MoveBottles(bottles[i], conveyor_Part2, i));
            // pills
            pills[i] = levels[levelNo].bottles[i].pillPrefab;
            pills[i].GetComponent <Rigidbody>().isKinematic = false;
            pills[i].transform.GetChild(0).GetComponent <MeshRenderer>().material = levels[levelNo].bottles[i].colorMat;
            StartCoroutine(petri.transform.GetChild(0).GetComponent <PillSpawner>().SpawnPills(pills[i], levels[levelNo].bottles[i].maxPills));
        }
    }