MaterialProps SiAVObjectPropertiesToMaterialProperties(SiAVObject obj) { // Find relevant properties. SiTexturingProperty texturingProperty = null; foreach (var propRef in obj.Properties) { var prop = _file.Blocks[propRef.Value]; if (prop is SiTexturingProperty) { texturingProperty = (SiTexturingProperty)prop; } } // Create the material properties. var mp = new MaterialProps(); // Apply textures. if (texturingProperty != null) { mp.Textures = ConfigureTextureProperties(texturingProperty); } return(mp); }
void ApplySiAVObject(SiAVObject siAVObject, GameObject obj) { obj.transform.position = SifUtils.SifPointToUnityPoint(siAVObject.Translation); obj.transform.rotation = SifUtils.SifRotationMatrixToUnityQuaternion(siAVObject.Rotation); obj.transform.localScale = siAVObject.Scale * Vector3.one; }