Esempio n. 1
0
 public void CreateData(DFBlock.RmbBlockDoorRecord data, bool isExterior)
 {
     HideComponents();
     type            = DataType.Door;
     this.isExterior = isExterior;
     openRotation    = data.OpenRotation;
 }
        public static GameObject AddDoorObject(DFBlock.RmbBlockDoorRecord rmbBlock)
        {
            DaggerfallUnity dfUnity = DaggerfallUnity.Instance;

            // Get model data
            ModelData modelData;

            dfUnity.MeshReader.GetModelData(9000, out modelData);

            Vector3 modelRotation = new Vector3(0, -rmbBlock.YRotation / BlocksFile.RotationDivisor, 0);
            Vector3 modelPosition = new Vector3(rmbBlock.XPos, -rmbBlock.YPos, rmbBlock.ZPos) * MeshReader.GlobalScale;

            //Matrix4x4 modelMatrix = Matrix4x4.TRS(modelPosition, Quaternion.Euler(modelRotation), Vector3.one);

            GameObject go = DaggerfallWorkshop.Utility.GameObjectHelper.CreateDaggerfallMeshGameObject(9000, null);

            go.transform.rotation = Quaternion.Euler(modelRotation);
            go.transform.position = modelPosition;
            return(go);
        }