private bool ContainsObsoleteCloudLayerComponents() { MonoBehaviour targetScript = target as MonoBehaviour; CloudLayer cloudLayerScript = targetScript.GetComponent <CloudLayer>(); bool containsObsoleteComponents = cloudLayerScript != null; return(containsObsoleteComponents); }
private static void ConvertCloudLayerToCloudLayerData(CloudLayer cloudLayer, SerializedProperty element, int index) { element.isExpanded = true; element.FindPropertyRelative(CloudLayerData.PATH_IS_VISIBLE).boolValue = cloudLayer.enabled; element.FindPropertyRelative(CloudLayerData.PATH_LAYER_NAME).stringValue = "Cloud Layer " + (index + 1); element.FindPropertyRelative(CloudLayerData.PATH_BLEND_MODE).enumValueIndex = (int)cloudLayer.TextureBlendMode; element.FindPropertyRelative(CloudLayerData.PATH_OPACITY).floatValue = cloudLayer.Opacity; element.FindPropertyRelative(CloudLayerData.PATH_COVERAGE).floatValue = cloudLayer.Coverage; element.FindPropertyRelative(CloudLayerData.PATH_SOFTNESS).floatValue = cloudLayer.Softness; element.FindPropertyRelative(CloudLayerData.PATH_SPEED).floatValue = cloudLayer.Velocity.magnitude; element.FindPropertyRelative(CloudLayerData.PATH_DIRECTION).floatValue = ConvertVelocityToDirectionAngle(cloudLayer.Velocity); element.FindPropertyRelative(CloudLayerData.PATH_TEXTURE).objectReferenceValue = cloudLayer.Texture; element.FindPropertyRelative(CloudLayerData.PATH_TEXTURE_TILING).vector2Value = cloudLayer.TextureTiling; element.FindPropertyRelative(CloudLayerData.PATH_TEXTURE_OFFSET).vector2Value = cloudLayer.TextureOffset; }