Esempio n. 1
0
    private void InstantiateInteriorObjects()
    {
        GameObject gameObject = null;
        GameObject prefab     = null;
        var        createObj  = new CreateGameObject();

        Vector3 pos;
        Vector3 angle;

        //Loading Interior GameObjects:
        for (var i = 0; i < this.binaryTemp.objName_Interior.Length; i++)
        {
            var interiorObj = new GameObject_Interior();

            pos    = new Vector3(binaryTemp.pos_Interior[i, 0], binaryTemp.pos_Interior[i, 1], binaryTemp.pos_Interior[i, 2]);
            angle  = new Vector3(binaryTemp.angle_Interior[i, 0], binaryTemp.angle_Interior[i, 1], binaryTemp.angle_Interior[i, 2]);
            prefab = (GameObject)Resources.Load("prefabs/" + binaryTemp.objName_Interior[i], typeof(GameObject));

            // Instantiate object
            gameObject = createObj.InstantiateGameObj(prefab, pos);

            // Setting objects data
            gameObject = createObj.GameObjSetting(gameObject, angle);

            //adding the game object to modelObj
            interiorObj.SetGameObject(gameObject, pos, angle, prefab.name);
            //adding the game object to list of instantiated game objects
            InstantiatedGameObject._obj.SetInstantiatedInteriorObj(interiorObj);
        }
    }
Esempio n. 2
0
    private void InteriorObject(Vector3 point)
    {
        var createObj = new CreateGameObject();

        point.y = 0.06f;
        var gameObject = createObj.InstantiateGameObj(selectedObject, point);

        gameObject.transform.eulerAngles = new Vector3(Interface._obj.GetAngle_InteriorObj(), 0, 0);

        if (Interface._obj.GetCameraMode_Ortho())
        {
            gameObject.GetComponent <ObjectDrag>().enabled = true;
        }

        var interiorObj = new GameObject_Interior();

        interiorObj.SetGameObject(gameObject, gameObject.transform.position, gameObject.transform.eulerAngles, selectedObject.name);

        InstantiatedGameObject._obj.AddGameObjectInterior(interiorObj);
    }